Chromium Code Reviews

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

Issue 2973004: [Mac]Implement ViewID support. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Turns out that, it's not a good solution. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « chrome/browser/cocoa/tab_controller.h ('k') | chrome/browser/cocoa/tab_controller_target.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/l10n_util_mac.h" 5 #include "app/l10n_util_mac.h"
6 #include "base/mac_util.h" 6 #include "base/mac_util.h"
7 #import "chrome/browser/browser_theme_provider.h" 7 #import "chrome/browser/browser_theme_provider.h"
8 #import "chrome/browser/cocoa/menu_controller.h" 8 #import "chrome/browser/cocoa/menu_controller.h"
9 #import "chrome/browser/cocoa/tab_controller.h" 9 #import "chrome/browser/cocoa/tab_controller.h"
10 #import "chrome/browser/cocoa/tab_controller_target.h" 10 #import "chrome/browser/cocoa/tab_controller_target.h"
(...skipping 296 matching lines...)
307 307
308 // Called by the tabs to determine whether we are in rapid (tab) closure mode. 308 // Called by the tabs to determine whether we are in rapid (tab) closure mode.
309 - (BOOL)inRapidClosureMode { 309 - (BOOL)inRapidClosureMode {
310 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) { 310 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) {
311 return [[self target] performSelector:@selector(inRapidClosureMode)] ? 311 return [[self target] performSelector:@selector(inRapidClosureMode)] ?
312 YES : NO; 312 YES : NO;
313 } 313 }
314 return NO; 314 return NO;
315 } 315 }
316 316
317 - (ViewID)viewID {
318 NSInteger total = 0;
319 NSInteger index = [[self target] indexForTabController:self inTotal:&total];
320 DCHECK(index >= 0 && index < total);
321
322 if (index >= 0 && index <= (VIEW_ID_TAB_9 - VIEW_ID_TAB_0))
323 return static_cast<ViewID>(index + VIEW_ID_TAB_0);
324 else if (index == total - 1)
325 return VIEW_ID_TAB_LAST;
326 return VIEW_ID_NONE;
327 }
328
317 @end 329 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/tab_controller.h ('k') | chrome/browser/cocoa/tab_controller_target.h » ('j') | no next file with comments »

Powered by Google App Engine