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 |