summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 15:40:45 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 15:40:45 +0000
commit10946079e34f1a627e9afa232049469a6655cc17 (patch)
tree6de5c4fa11f7fb6ede9601de1acc86e4a53aa1b2 /views/controls
parent334bef925113a03dac5dc92184ab7ce51e06a386 (diff)
downloadchromium_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')
-rw-r--r--views/controls/button/menu_button.cc3
-rw-r--r--views/controls/button/radio_button.cc6
-rw-r--r--views/controls/combobox/native_combobox_views.cc2
-rw-r--r--views/controls/menu/menu_host.cc2
-rw-r--r--views/controls/menu/menu_host.h2
-rw-r--r--views/controls/menu/menu_host_root_view.cc2
-rw-r--r--views/controls/menu/menu_host_root_view.h2
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_gtk.cc11
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_win.cc8
-rw-r--r--views/controls/textfield/native_textfield_views.cc4
10 files changed, 20 insertions, 22 deletions
diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc
index 353205d..0e5d702 100644
--- a/views/controls/button/menu_button.cc
+++ b/views/controls/button/menu_button.cc
@@ -100,7 +100,8 @@ bool MenuButton::Activate() {
// matter where the user pressed. To force RootView to recalculate the
// mouse target during the mouse press we explicitly set the mouse handler
// to NULL.
- GetRootView()->SetMouseHandler(NULL);
+ static_cast<internal::RootView*>(GetWidget()->GetRootView())->
+ SetMouseHandler(NULL);
menu_visible_ = true;
diff --git a/views/controls/button/radio_button.cc b/views/controls/button/radio_button.cc
index a5292eb..249cba2 100644
--- a/views/controls/button/radio_button.cc
+++ b/views/controls/button/radio_button.cc
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "ui/base/accessibility/accessible_view_state.h"
-#include "views/widget/root_view.h"
+#include "views/widget/widget.h"
namespace views {
@@ -71,7 +71,7 @@ void RadioButton::GetAccessibleState(ui::AccessibleViewState* state) {
View* RadioButton::GetSelectedViewForGroup(int group_id) {
std::vector<View*> views;
- GetRootView()->GetViewsWithGroup(group_id, &views);
+ GetWidget()->GetRootView()->GetViewsWithGroup(group_id, &views);
if (views.empty())
return NULL;
@@ -170,7 +170,7 @@ void RadioButtonNt::GetAccessibleState(ui::AccessibleViewState* state) {
View* RadioButtonNt::GetSelectedViewForGroup(int group_id) {
std::vector<View*> views;
- GetRootView()->GetViewsWithGroup(group_id, &views);
+ GetWidget()->GetRootView()->GetViewsWithGroup(group_id, &views);
if (views.empty())
return NULL;
diff --git a/views/controls/combobox/native_combobox_views.cc b/views/controls/combobox/native_combobox_views.cc
index 624947b..10e197f 100644
--- a/views/controls/combobox/native_combobox_views.cc
+++ b/views/controls/combobox/native_combobox_views.cc
@@ -271,7 +271,7 @@ bool NativeComboboxViews::IsComboboxViewsEnabled() {
#if defined(TOUCH_UI)
return true;
#else
- return combobox_view_enabled || RootView::IsPureViews();
+ return combobox_view_enabled || Widget::IsPureViews();
#endif
}
diff --git a/views/controls/menu/menu_host.cc b/views/controls/menu/menu_host.cc
index 70ea88c..82fd186 100644
--- a/views/controls/menu/menu_host.cc
+++ b/views/controls/menu/menu_host.cc
@@ -79,7 +79,7 @@ void MenuHost::ReleaseMenuHostCapture() {
////////////////////////////////////////////////////////////////////////////////
// MenuHost, Widget overrides:
-RootView* MenuHost::CreateRootView() {
+internal::RootView* MenuHost::CreateRootView() {
return new MenuHostRootView(this, submenu_);
}
diff --git a/views/controls/menu/menu_host.h b/views/controls/menu/menu_host.h
index 1849de4..a33f445 100644
--- a/views/controls/menu/menu_host.h
+++ b/views/controls/menu/menu_host.h
@@ -65,7 +65,7 @@ class MenuHost : public Widget,
private:
// Overridden from Widget:
- virtual RootView* CreateRootView() OVERRIDE;
+ virtual internal::RootView* CreateRootView() OVERRIDE;
virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE;
// Overridden from NativeMenuHostDelegate:
diff --git a/views/controls/menu/menu_host_root_view.cc b/views/controls/menu/menu_host_root_view.cc
index e1c119f..b3676fa0 100644
--- a/views/controls/menu/menu_host_root_view.cc
+++ b/views/controls/menu/menu_host_root_view.cc
@@ -11,7 +11,7 @@ namespace views {
MenuHostRootView::MenuHostRootView(Widget* widget,
SubmenuView* submenu)
- : RootView(widget),
+ : internal::RootView(widget),
submenu_(submenu),
forward_drag_to_menu_controller_(true) {
}
diff --git a/views/controls/menu/menu_host_root_view.h b/views/controls/menu/menu_host_root_view.h
index 32200c5..11c674c 100644
--- a/views/controls/menu/menu_host_root_view.h
+++ b/views/controls/menu/menu_host_root_view.h
@@ -19,7 +19,7 @@ class SubmenuView;
//
// As all the menu items are owned by the root menu item, care must be taken
// such that when MenuHostRootView is deleted it doesn't delete the menu items.
-class MenuHostRootView : public RootView {
+class MenuHostRootView : public internal::RootView {
public:
MenuHostRootView(Widget* widget, SubmenuView* submenu);
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())
diff --git a/views/controls/textfield/native_textfield_views.cc b/views/controls/textfield/native_textfield_views.cc
index ad3497b..0eeb291 100644
--- a/views/controls/textfield/native_textfield_views.cc
+++ b/views/controls/textfield/native_textfield_views.cc
@@ -28,7 +28,7 @@
#include "views/ime/input_method.h"
#include "views/metrics.h"
#include "views/views_delegate.h"
-#include "views/widget/root_view.h"
+#include "views/widget/widget.h"
#if defined(OS_LINUX)
#include "ui/gfx/gtk_util.h"
@@ -530,7 +530,7 @@ bool NativeTextfieldViews::IsTextfieldViewsEnabled() {
#if defined(TOUCH_UI)
return true;
#else
- return textfield_view_enabled || RootView::IsPureViews();
+ return textfield_view_enabled || Widget::IsPureViews();
#endif
}