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

Unified Diff: chrome/browser/cocoa/tab_strip_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_unittest.mm ('k') | chrome/browser/cocoa/tab_strip_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_strip_controller.mm
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index d2caf62652bfaa99ad8efae27f1be51ebad0ae0a..68bd984fbc734670b066abb77c9fdf17d2463b17 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -653,6 +653,22 @@ private:
return tabStripModel_->IsContextMenuCommandEnabled(index, command) ? YES : NO;
}
+// Returns the index of the tab controller. Returns -1 if not present.
+// Unlike modelIndexForTabView, this method does not care about whether the tab
+// is closing or not.
+- (NSInteger)indexForTabController:(TabController*)controller
+ inTotal:(NSInteger*)total {
+ if (total)
+ *total = [tabArray_ count];
+ NSInteger index = 0;
+ for (TabController* current in tabArray_.get()) {
+ if (current == controller)
+ return index;
+ ++index;
+ }
+ return -1;
+}
+
- (void)insertPlaceholderForTab:(TabView*)tab
frame:(NSRect)frame
yStretchiness:(CGFloat)yStretchiness {
« no previous file with comments | « chrome/browser/cocoa/tab_controller_unittest.mm ('k') | chrome/browser/cocoa/tab_strip_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698