diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-25 00:59:15 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-25 00:59:15 +0000 |
commit | b8881b434694b1d56d081d9133ff97887a70bd38 (patch) | |
tree | 2d8f92788b97cfe24b9ccefbb9db183177e54351 /ui/views | |
parent | 87d6297c0888fd9ddfaf458928e026d2b4e53b67 (diff) | |
download | chromium_src-b8881b434694b1d56d081d9133ff97887a70bd38.zip chromium_src-b8881b434694b1d56d081d9133ff97887a70bd38.tar.gz chromium_src-b8881b434694b1d56d081d9133ff97887a70bd38.tar.bz2 |
Revert 123592 - Remove a bunch more uses of RootWindow::GetInstance()
http://crbug.com/112131
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9460025
TBR=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9464038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/controls/menu/menu_controller.cc | 6 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 8 | ||||
-rw-r--r-- | ui/views/widget/tooltip_manager_aura.cc | 14 |
3 files changed, 12 insertions, 16 deletions
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc index 1cce7fa..d3b8e3f 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -2017,10 +2017,8 @@ void MenuController::SetExitType(ExitType type) { // is necessary to exit from nested loop (See Dispatch methods). // Send non-op event so that Dispatch method will always be called. // crbug.com/104684. - if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) { - owner_->GetNativeView()->GetRootWindow()->PostNativeEvent( - ui::CreateNoopEvent()); - } + if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) + aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); #endif } diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index ca824d6..8435698 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -106,10 +106,10 @@ void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) { class NativeWidgetAura::ActiveWindowObserver : public aura::WindowObserver { public: explicit ActiveWindowObserver(NativeWidgetAura* host) : host_(host) { - host_->GetNativeView()->GetRootWindow()->AddObserver(this); + aura::RootWindow::GetInstance()->AddObserver(this); } virtual ~ActiveWindowObserver() { - host_->GetNativeView()->GetRootWindow()->RemoveObserver(this); + aura::RootWindow::GetInstance()->RemoveObserver(this); } // Overridden from aura::WindowObserver: @@ -320,7 +320,7 @@ bool NativeWidgetAura::HasMouseCapture() const { } InputMethod* NativeWidgetAura::CreateInputMethod() { - aura::RootWindow* root_window = window_->GetRootWindow(); + aura::RootWindow* root_window = aura::RootWindow::GetInstance(); ui::InputMethod* host = root_window->GetProperty(aura::client::kRootWindowInputMethodKey); InputMethod* input_method = new InputMethodBridge(this, host); @@ -587,7 +587,7 @@ void NativeWidgetAura::SchedulePaintInRect(const gfx::Rect& rect) { void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { cursor_ = cursor; - window_->GetRootWindow()->SetCursor(cursor); + aura::RootWindow::GetInstance()->SetCursor(cursor); } void NativeWidgetAura::ClearNativeFocus() { diff --git a/ui/views/widget/tooltip_manager_aura.cc b/ui/views/widget/tooltip_manager_aura.cc index 3bed930..efddcfe 100644 --- a/ui/views/widget/tooltip_manager_aura.cc +++ b/ui/views/widget/tooltip_manager_aura.cc @@ -52,10 +52,9 @@ TooltipManagerAura::~TooltipManagerAura() { void TooltipManagerAura::UpdateTooltip() { if (aura::client::GetTooltipClient()) { - aura::RootWindow* root_window = - native_widget_aura_->GetNativeView()->GetRootWindow(); - gfx::Point view_point = root_window->last_mouse_location(); - aura::Window::ConvertPointToWindow(root_window, + gfx::Point view_point = + aura::RootWindow::GetInstance()->last_mouse_location(); + aura::Window::ConvertPointToWindow(aura::RootWindow::GetInstance(), native_widget_aura_->GetNativeView(), &view_point); View* view = GetViewUnderPoint(view_point); if (view) { @@ -72,10 +71,9 @@ void TooltipManagerAura::UpdateTooltip() { void TooltipManagerAura::TooltipTextChanged(View* view) { if (aura::client::GetTooltipClient()) { - aura::RootWindow* root_window = - native_widget_aura_->GetNativeView()->GetRootWindow(); - gfx::Point view_point = root_window->last_mouse_location(); - aura::Window::ConvertPointToWindow(root_window, + gfx::Point view_point = + aura::RootWindow::GetInstance()->last_mouse_location(); + aura::Window::ConvertPointToWindow(aura::RootWindow::GetInstance(), native_widget_aura_->GetNativeView(), &view_point); View* target = GetViewUnderPoint(view_point); if (target != view) |