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

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

Issue 7080064: [Mac] Refactor the logic of tab dragging out of TabView and into a new helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/mac/mac_util.h" 5 #include "base/mac/mac_util.h"
6 #import "chrome/browser/themes/theme_service.h" 6 #import "chrome/browser/themes/theme_service.h"
7 #import "chrome/browser/ui/cocoa/menu_controller.h" 7 #import "chrome/browser/ui/cocoa/menu_controller.h"
8 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" 8 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
9 #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h" 9 #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h"
10 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" 10 #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 // Called by the tabs to determine whether we are in rapid (tab) closure mode. 313 // Called by the tabs to determine whether we are in rapid (tab) closure mode.
314 - (BOOL)inRapidClosureMode { 314 - (BOOL)inRapidClosureMode {
315 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) { 315 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) {
316 return [[self target] performSelector:@selector(inRapidClosureMode)] ? 316 return [[self target] performSelector:@selector(inRapidClosureMode)] ?
317 YES : NO; 317 YES : NO;
318 } 318 }
319 return NO; 319 return NO;
320 } 320 }
321 321
322 // The following methods are invoked from the TabView and are forwarded to the
323 // TabStripDragController.
324 - (BOOL)tabCanBeDragged:(TabController*)controller {
325 return [[target_ dragController] tabCanBeDragged:controller];
326 }
327
328 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab {
329 [[target_ dragController] maybeStartDrag:event forTab:tab];
330 }
331
332 - (void)continueDrag:(NSEvent*)event {
333 [[target_ dragController] continueDrag:event];
334 }
335
336 - (void)endDrag:(NSEvent*)event {
337 [[target_ dragController] endDrag:event];
338 }
339
322 @end 340 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698