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

Unified Diff: chrome/views/tabbed_pane.cc

Issue 15031: Input box's context menu/language settings should set ... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years 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/views/tabbed_pane.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/tabbed_pane.cc
===================================================================
--- chrome/views/tabbed_pane.cc (revision 7195)
+++ chrome/views/tabbed_pane.cc (working copy)
@@ -132,6 +132,12 @@
DoSelectTabAt(index);
}
+void TabbedPane::SelectTabForContents(const View* contents) {
+ int index = GetIndexOfTab(contents);
+ if (index != -1)
+ SelectTabAt(index);
+}
+
int TabbedPane::GetTabCount() {
return TabCtrl_GetItemCount(tab_control_);
}
@@ -216,6 +222,15 @@
listener_->TabSelectedAt(index);
}
+int TabbedPane::GetIndexOfTab(const View* contents) const {
+ DCHECK(contents);
+ std::vector<View*>::const_iterator i = std::find(tab_views_.begin(),
+ tab_views_.end(), contents);
+ if (i != tab_views_.end())
+ return static_cast<int>(i - tab_views_.begin());
+ return -1;
+}
+
void TabbedPane::Layout() {
NativeControl::Layout();
ResizeContents(GetNativeControlHWND());
« no previous file with comments | « chrome/views/tabbed_pane.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698