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

Unified 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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_controller.mm
diff --git a/chrome/browser/cocoa/tab_controller.mm b/chrome/browser/cocoa/tab_controller.mm
index 50eb2688b07123aed74a9c712609d1bb4c7784f0..fbf57374332855594227682fd8878dc5faa93002 100644
--- a/chrome/browser/cocoa/tab_controller.mm
+++ b/chrome/browser/cocoa/tab_controller.mm
@@ -314,4 +314,16 @@ class MenuDelegate : public menus::SimpleMenuModel::Delegate {
return NO;
}
+- (ViewID)viewID {
+ NSInteger total = 0;
+ NSInteger index = [[self target] indexForTabController:self inTotal:&total];
+ DCHECK(index >= 0 && index < total);
+
+ if (index >= 0 && index <= (VIEW_ID_TAB_9 - VIEW_ID_TAB_0))
+ return static_cast<ViewID>(index + VIEW_ID_TAB_0);
+ else if (index == total - 1)
+ return VIEW_ID_TAB_LAST;
+ return VIEW_ID_NONE;
+}
+
@end
« 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
This is Rietveld 408576698