Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_controller.mm

Issue 918533005: Mac: Optimize TabView drawing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 NSMakeRect(127, 4, 18, 18)]); 104 NSMakeRect(127, 4, 18, 18)]);
105 [closeButton_ setAutoresizingMask:NSViewMinXMargin]; 105 [closeButton_ setAutoresizingMask:NSViewMinXMargin];
106 [closeButton_ setTarget:self]; 106 [closeButton_ setTarget:self];
107 [closeButton_ setAction:@selector(closeTab:)]; 107 [closeButton_ setAction:@selector(closeTab:)];
108 108
109 base::scoped_nsobject<TabView> view([[TabView alloc] 109 base::scoped_nsobject<TabView> view([[TabView alloc]
110 initWithFrame:NSMakeRect(0, 0, 160, [TabController defaultTabHeight]) 110 initWithFrame:NSMakeRect(0, 0, 160, [TabController defaultTabHeight])
111 controller:self 111 controller:self
112 closeButton:closeButton_]); 112 closeButton:closeButton_]);
113 [view setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin]; 113 [view setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin];
114 [view setPostsFrameChangedNotifications:NO];
115 [view setPostsBoundsChangedNotifications:NO];
114 [view addSubview:iconView_]; 116 [view addSubview:iconView_];
115 [view addSubview:closeButton_]; 117 [view addSubview:closeButton_];
116 [view setTitleFrame:titleFrame]; 118 [view setTitleFrame:titleFrame];
117 [super setView:view]; 119 [super setView:view];
118 120
119 isIconShowing_ = YES; 121 isIconShowing_ = YES;
120 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; 122 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
121 [defaultCenter addObserver:self 123 [defaultCenter addObserver:self
122 selector:@selector(themeChangedNotification:) 124 selector:@selector(themeChangedNotification:)
123 name:kBrowserThemeDidChangeNotification 125 name:kBrowserThemeDidChangeNotification
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // TabStripDragController. 450 // TabStripDragController.
449 - (BOOL)tabCanBeDragged:(TabController*)controller { 451 - (BOOL)tabCanBeDragged:(TabController*)controller {
450 return [[target_ dragController] tabCanBeDragged:controller]; 452 return [[target_ dragController] tabCanBeDragged:controller];
451 } 453 }
452 454
453 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab { 455 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab {
454 [[target_ dragController] maybeStartDrag:event forTab:tab]; 456 [[target_ dragController] maybeStartDrag:event forTab:tab];
455 } 457 }
456 458
457 @end 459 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_view.h » ('j') | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698