| 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());
|
|
|