diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-20 15:40:45 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-20 15:40:45 +0000 |
commit | 10946079e34f1a627e9afa232049469a6655cc17 (patch) | |
tree | 6de5c4fa11f7fb6ede9601de1acc86e4a53aa1b2 /views/controls/tabbed_pane | |
parent | 334bef925113a03dac5dc92184ab7ce51e06a386 (diff) | |
download | chromium_src-10946079e34f1a627e9afa232049469a6655cc17.zip chromium_src-10946079e34f1a627e9afa232049469a6655cc17.tar.gz chromium_src-10946079e34f1a627e9afa232049469a6655cc17.tar.bz2 |
Move RootView to the internal namespace.
Most people should not be using the RootView type. The few cases that do should static_cast for now, until I can find a way to expose the functionality they need on Widget.
BUG=72040
TEST=none
TBR=sky
Review URL: http://codereview.chromium.org/7040018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/tabbed_pane')
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_gtk.cc | 11 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_win.cc | 8 |
2 files changed, 8 insertions, 11 deletions
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc index c35e862..872a7e3 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc @@ -17,7 +17,6 @@ #include "views/controls/tabbed_pane/tabbed_pane_listener.h" #include "views/layout/fill_layout.h" #include "views/widget/native_widget.h" -#include "views/widget/root_view.h" #include "views/widget/widget.h" namespace views { @@ -90,9 +89,8 @@ View* NativeTabbedPaneGtk::RemoveTabAtIndex(int index) { gtk_notebook_remove_page(GTK_NOTEBOOK(native_view()), index); // Removing a tab might change the size of the tabbed pane. - RootView* root_view = GetRootView(); - if (root_view) - GetRootView()->Layout(); + if (GetWidget()) + GetWidget()->GetRootView()->Layout(); return removed_tab; } @@ -191,9 +189,8 @@ void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, gtk_notebook_set_current_page(GTK_NOTEBOOK(native_view()), 0); // Relayout the hierarchy, since the added tab might require more space. - RootView* root_view = GetRootView(); - if (root_view) - GetRootView()->Layout(); + if (GetWidget()) + GetWidget()->GetRootView()->Layout(); } Widget* NativeTabbedPaneGtk::GetWidgetAt(int index) { diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index 1a025cb..4933538 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -155,7 +155,7 @@ void NativeTabbedPaneWin::AddTabAtIndex(int index, const std::wstring& title, // The newly added tab may have made the contents window smaller. ResizeContents(); - RootView* content_root = content_window_->GetRootView(); + View* content_root = content_window_->GetRootView(); content_root->AddChildView(contents); // Switch to the newly added tab if requested; if (tab_views_.size() == 1 && select_if_first_tab) @@ -303,7 +303,7 @@ void NativeTabbedPaneWin::CreateNativeControl() { if (base::i18n::IsRTL()) l10n_util::HWNDSetRTLLayout(tab_control); - RootView* root_view = content_window_->GetRootView(); + View* root_view = content_window_->GetRootView(); tab_layout_manager_ = new TabLayout(); root_view->SetLayoutManager(tab_layout_manager_); DWORD sys_color = ::GetSysColor(COLOR_3DHILIGHT); @@ -371,7 +371,7 @@ void NativeTabbedPaneWin::InitializeTabs() { for (size_t i = 0; i < tab_titles_.size(); ++i) AddNativeTab(i, tab_titles_[i]); - RootView* content_root = content_window_->GetRootView(); + View* content_root = content_window_->GetRootView(); for (std::vector<View*>::iterator tab(tab_views_.begin()); tab != tab_views_.end(); ++tab) content_root->AddChildView(*tab); @@ -380,7 +380,7 @@ void NativeTabbedPaneWin::InitializeTabs() { void NativeTabbedPaneWin::DoSelectTabAt(int index, boolean invoke_listener) { selected_index_ = index; if (content_window_) { - RootView* content_root = content_window_->GetRootView(); + View* content_root = content_window_->GetRootView(); tab_layout_manager_->SwitchToPage(content_root, tab_views_.at(index)); } if (invoke_listener && tabbed_pane_->listener()) |