OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 dragController_.reset( | 361 dragController_.reset( |
362 [[TabStripDragController alloc] initWithTabStripController:self]); | 362 [[TabStripDragController alloc] initWithTabStripController:self]); |
363 tabContentsArray_.reset([[NSMutableArray alloc] init]); | 363 tabContentsArray_.reset([[NSMutableArray alloc] init]); |
364 tabArray_.reset([[NSMutableArray alloc] init]); | 364 tabArray_.reset([[NSMutableArray alloc] init]); |
365 NSWindow* browserWindow = [view window]; | 365 NSWindow* browserWindow = [view window]; |
366 | 366 |
367 // Important note: any non-tab subviews not added to |permanentSubviews_| | 367 // Important note: any non-tab subviews not added to |permanentSubviews_| |
368 // (see |-addSubviewToPermanentList:|) will be wiped out. | 368 // (see |-addSubviewToPermanentList:|) will be wiped out. |
369 permanentSubviews_.reset([[NSMutableArray alloc] init]); | 369 permanentSubviews_.reset([[NSMutableArray alloc] init]); |
370 | 370 |
| 371 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
371 defaultFavicon_.reset( | 372 defaultFavicon_.reset( |
372 [gfx::GetCachedImageWithName(@"nav.pdf") retain]); | 373 [rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON) retain]); |
373 | 374 |
374 [self setLeftIndentForControls:[[self class] defaultLeftIndentForControls]]; | 375 [self setLeftIndentForControls:[[self class] defaultLeftIndentForControls]]; |
375 [self setRightIndentForControls:0]; | 376 [self setRightIndentForControls:0]; |
376 | 377 |
377 // TODO(viettrungluu): WTF? "For some reason, if the view is present in the | 378 // TODO(viettrungluu): WTF? "For some reason, if the view is present in the |
378 // nib a priori, it draws correctly. If we create it in code and add it to | 379 // nib a priori, it draws correctly. If we create it in code and add it to |
379 // the tab view, it draws with all sorts of crazy artifacts." | 380 // the tab view, it draws with all sorts of crazy artifacts." |
380 newTabButton_ = [view getNewTabButton]; | 381 newTabButton_ = [view getNewTabButton]; |
381 [self addSubviewToPermanentList:newTabButton_]; | 382 [self addSubviewToPermanentList:newTabButton_]; |
382 [newTabButton_ setTarget:self]; | 383 [newTabButton_ setTarget:self]; |
(...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 NSInteger index = [self indexFromModelIndex:modelIndex]; | 2122 NSInteger index = [self indexFromModelIndex:modelIndex]; |
2122 BrowserWindowController* controller = | 2123 BrowserWindowController* controller = |
2123 (BrowserWindowController*)[[switchView_ window] windowController]; | 2124 (BrowserWindowController*)[[switchView_ window] windowController]; |
2124 DCHECK(index >= 0); | 2125 DCHECK(index >= 0); |
2125 if (index >= 0) { | 2126 if (index >= 0) { |
2126 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 2127 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
2127 } | 2128 } |
2128 } | 2129 } |
2129 | 2130 |
2130 @end | 2131 @end |
OLD | NEW |