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_view.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
6 | 6 |
7 #include <cmath> // floor | 7 #include <cmath> // floor |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 NSMakeRect(295, 0, 40, 27)]); | 33 NSMakeRect(295, 0, 40, 27)]); |
34 [newTabButton_ setToolTip:l10n_util::GetNSString(IDS_TOOLTIP_NEW_TAB)]; | 34 [newTabButton_ setToolTip:l10n_util::GetNSString(IDS_TOOLTIP_NEW_TAB)]; |
35 | 35 |
36 // Set lastMouseUp_ = -1000.0 so that timestamp-lastMouseUp_ is big unless | 36 // Set lastMouseUp_ = -1000.0 so that timestamp-lastMouseUp_ is big unless |
37 // lastMouseUp_ has been reset. | 37 // lastMouseUp_ has been reset. |
38 lastMouseUp_ = -1000.0; | 38 lastMouseUp_ = -1000.0; |
39 | 39 |
40 // Register to be an URL drop target. | 40 // Register to be an URL drop target. |
41 dropHandler_.reset([[URLDropTargetHandler alloc] initWithView:self]); | 41 dropHandler_.reset([[URLDropTargetHandler alloc] initWithView:self]); |
42 | 42 |
43 [self cr_setWantsLayer:YES]; | 43 [self setWantsLayer:YES]; |
44 } | 44 } |
45 return self; | 45 return self; |
46 } | 46 } |
47 | 47 |
48 // Draw bottom border bitmap. Each tab is responsible for mimicking this bottom | 48 // Draw bottom border bitmap. Each tab is responsible for mimicking this bottom |
49 // border, unless it's the selected tab. | 49 // border, unless it's the selected tab. |
50 - (void)drawBorder:(NSRect)dirtyRect { | 50 - (void)drawBorder:(NSRect)dirtyRect { |
51 ThemeService* themeProvider = | 51 ThemeService* themeProvider = |
52 static_cast<ThemeService*>([[self window] themeProvider]); | 52 static_cast<ThemeService*>([[self window] themeProvider]); |
53 if (!themeProvider) | 53 if (!themeProvider) |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 - (void)setNewTabButton:(NewTabButton*)button { | 271 - (void)setNewTabButton:(NewTabButton*)button { |
272 newTabButton_.reset([button retain]); | 272 newTabButton_.reset([button retain]); |
273 } | 273 } |
274 | 274 |
275 - (void)setController:(TabStripController*)controller { | 275 - (void)setController:(TabStripController*)controller { |
276 controller_ = controller; | 276 controller_ = controller; |
277 } | 277 } |
278 | 278 |
279 @end | 279 @end |
OLD | NEW |