diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/gestures/gesture_recognizer_unittest.cc | 20 | ||||
-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 |
4 files changed, 22 insertions, 26 deletions
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index b5734fc..ffe8e59 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -437,10 +437,10 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) { static_cast<TimerTestGestureSequence*>( gesture_recognizer->GetGestureSequenceForTesting()); - root_window()->SetGestureRecognizerForTesting(gesture_recognizer); + RootWindow::GetInstance()->SetGestureRecognizerForTesting(gesture_recognizer); TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), 0); - root_window()->DispatchTouchEvent(&press1); + RootWindow::GetInstance()->DispatchTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); // We haven't pressed long enough for a long press to occur @@ -453,7 +453,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) { delegate->Reset(); TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), 0); - root_window()->DispatchTouchEvent(&release1); + RootWindow::GetInstance()->DispatchTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); } @@ -475,10 +475,10 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) { static_cast<TimerTestGestureSequence*>( gesture_recognizer->GetGestureSequenceForTesting()); - root_window()->SetGestureRecognizerForTesting(gesture_recognizer); + RootWindow::GetInstance()->SetGestureRecognizerForTesting(gesture_recognizer); TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), 0); - root_window()->DispatchTouchEvent(&press1); + RootWindow::GetInstance()->DispatchTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); // We haven't pressed long enough for a long press to occur @@ -492,7 +492,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) { delegate->Reset(); TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), 0); - root_window()->DispatchTouchEvent(&release1); + RootWindow::GetInstance()->DispatchTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); } @@ -512,11 +512,11 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByPinch) { static_cast<TimerTestGestureSequence*>( gesture_recognizer->GetGestureSequenceForTesting()); - root_window()->SetGestureRecognizerForTesting(gesture_recognizer); + RootWindow::GetInstance()->SetGestureRecognizerForTesting(gesture_recognizer); delegate->Reset(); TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), 0); - root_window()->DispatchTouchEvent(&press); + RootWindow::GetInstance()->DispatchTouchEvent(&press); EXPECT_TRUE(delegate->tap_down()); // We haven't pressed long enough for a long press to occur @@ -525,7 +525,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByPinch) { // Pinch, to cancel the long press delegate->Reset(); TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1); - root_window()->DispatchTouchEvent(&press2); + RootWindow::GetInstance()->DispatchTouchEvent(&press2); EXPECT_TRUE(delegate->tap_down()); EXPECT_TRUE(delegate->pinch_begin()); @@ -537,7 +537,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByPinch) { delegate->Reset(); TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), 0); - root_window()->DispatchTouchEvent(&release1); + RootWindow::GetInstance()->DispatchTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); } 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) |