summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 19:50:52 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 19:50:52 +0000
commit6fe066bfeef64da98169273431696c777887fecb (patch)
treec87ce00e3e2460ec80ba0f010fc9cd1437b017ea /views/controls
parent96c6f4cadce6e374b67238ccf402ee45b3c5b432 (diff)
downloadchromium_src-6fe066bfeef64da98169273431696c777887fecb.zip
chromium_src-6fe066bfeef64da98169273431696c777887fecb.tar.gz
chromium_src-6fe066bfeef64da98169273431696c777887fecb.tar.bz2
Clean up a few things now that specialized window types are subclasses of Window/Widget.
BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7045010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/menu/menu_host.cc31
-rw-r--r--views/controls/menu/menu_host.h3
2 files changed, 11 insertions, 23 deletions
diff --git a/views/controls/menu/menu_host.cc b/views/controls/menu/menu_host.cc
index abebdce..70ea88c 100644
--- a/views/controls/menu/menu_host.cc
+++ b/views/controls/menu/menu_host.cc
@@ -40,56 +40,47 @@ void MenuHost::InitMenuHost(gfx::NativeWindow parent,
#endif
params.bounds = bounds;
params.native_widget = native_menu_host_->AsNativeWidget();
- GetWidget()->Init(params);
- GetWidget()->SetContentsView(contents_view);
+ Init(params);
+ SetContentsView(contents_view);
ShowMenuHost(do_capture);
}
bool MenuHost::IsMenuHostVisible() {
- return GetWidget()->IsVisible();
+ return IsVisible();
}
void MenuHost::ShowMenuHost(bool do_capture) {
- GetWidget()->Show();
+ Show();
if (do_capture)
native_menu_host_->StartCapturing();
}
void MenuHost::HideMenuHost() {
ReleaseMenuHostCapture();
- GetWidget()->Hide();
+ Hide();
}
void MenuHost::DestroyMenuHost() {
HideMenuHost();
destroying_ = true;
- static_cast<MenuHostRootView*>(GetWidget()->GetRootView())->ClearSubmenu();
- GetWidget()->Close();
+ static_cast<MenuHostRootView*>(GetRootView())->ClearSubmenu();
+ Close();
}
void MenuHost::SetMenuHostBounds(const gfx::Rect& bounds) {
- GetWidget()->SetBounds(bounds);
+ SetBounds(bounds);
}
void MenuHost::ReleaseMenuHostCapture() {
- if (GetWidget()->native_widget()->HasMouseCapture())
- GetWidget()->native_widget()->ReleaseMouseCapture();
-}
-
-Widget* MenuHost::GetWidget() {
- return native_menu_host_->AsNativeWidget()->GetWidget();
-}
-
-NativeWidget* MenuHost::GetNativeWidget() {
- return native_menu_host_->AsNativeWidget();
+ if (native_widget()->HasMouseCapture())
+ native_widget()->ReleaseMouseCapture();
}
////////////////////////////////////////////////////////////////////////////////
// MenuHost, Widget overrides:
-
RootView* MenuHost::CreateRootView() {
- return new MenuHostRootView(GetWidget(), submenu_);
+ return new MenuHostRootView(this, submenu_);
}
bool MenuHost::ShouldReleaseCaptureOnMouseReleased() const {
diff --git a/views/controls/menu/menu_host.h b/views/controls/menu/menu_host.h
index 0ebd1ac..1849de4 100644
--- a/views/controls/menu/menu_host.h
+++ b/views/controls/menu/menu_host.h
@@ -63,9 +63,6 @@ class MenuHost : public Widget,
// Returns the native window of the MenuHost.
gfx::NativeWindow GetMenuHostWindow();
- Widget* GetWidget();
- NativeWidget* GetNativeWidget();
-
private:
// Overridden from Widget:
virtual RootView* CreateRootView() OVERRIDE;