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

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

Issue 2404783002: [Mac] Avoid "adding unknown subview" warning. (Closed)
Patch Set: Merged with head Created 4 years, 2 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_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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // http://www.cocoabuilder.com/archive/cocoa/219261-conditional-mousedowncanmove window-for-nsview.html 222 // http://www.cocoabuilder.com/archive/cocoa/219261-conditional-mousedowncanmove window-for-nsview.html
223 // http://www.cocoabuilder.com/archive/cocoa/92973-brushed-metal-window-dragging .html 223 // http://www.cocoabuilder.com/archive/cocoa/92973-brushed-metal-window-dragging .html
224 - (void)trackClickForWindowMove:(NSEvent*)event; 224 - (void)trackClickForWindowMove:(NSEvent*)event;
225 @end 225 @end
226 226
227 @implementation TabStripControllerDragBlockingView 227 @implementation TabStripControllerDragBlockingView
228 - (BOOL)mouseDownCanMoveWindow { 228 - (BOOL)mouseDownCanMoveWindow {
229 return NO; 229 return NO;
230 } 230 }
231 231
232 // Called by AppKit to check if dragging this view should move the window.
233 // NSButton overrides this method in the same way so dragging window buttons
234 // has no effect.
235 - (NSRect)_opaqueRectForWindowMoveWhenInTitlebar {
tapted 2016/10/10 23:38:06 nit: we typically forward-declare these - I guess
Eugene But (OOO till 7-30) 2016/10/11 00:33:10 Done.
236 return [self bounds];
tapted 2016/10/10 23:38:06 Maybe comment here what the base class returns? (I
Eugene But (OOO till 7-30) 2016/10/11 00:33:10 Done in predeclaration.
237 }
238
232 - (id)initWithFrame:(NSRect)frameRect 239 - (id)initWithFrame:(NSRect)frameRect
233 controller:(TabStripController*)controller { 240 controller:(TabStripController*)controller {
234 if ((self = [super initWithFrame:frameRect])) { 241 if ((self = [super initWithFrame:frameRect])) {
235 controller_ = controller; 242 controller_ = controller;
236 } 243 }
237 return self; 244 return self;
238 } 245 }
239 246
240 // In "rapid tab closure" mode (i.e., the user is clicking close tab buttons in 247 // In "rapid tab closure" mode (i.e., the user is clicking close tab buttons in
241 // rapid succession), the animations confuse Cocoa's hit testing (which appears 248 // rapid succession), the animations confuse Cocoa's hit testing (which appears
(...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after
2323 for (int i = 0; i < tabStripModel_->count(); i++) { 2330 for (int i = 0; i < tabStripModel_->count(); i++) {
2324 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; 2331 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i];
2325 } 2332 }
2326 } 2333 }
2327 2334
2328 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { 2335 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen {
2329 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; 2336 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen];
2330 } 2337 }
2331 2338
2332 @end 2339 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698