diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-06 06:37:09 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-06 06:37:09 +0000 |
commit | 1aad332c7d47b1adc56708130d36dc1f513b67ae (patch) | |
tree | 9103e4927e301881f73e5798d4cac8f2f4986afd /ash/tooltips | |
parent | 382a064036206876b25fdd9052fe073721bebbb5 (diff) | |
download | chromium_src-1aad332c7d47b1adc56708130d36dc1f513b67ae.zip chromium_src-1aad332c7d47b1adc56708130d36dc1f513b67ae.tar.gz chromium_src-1aad332c7d47b1adc56708130d36dc1f513b67ae.tar.bz2 |
Add EnvEventFilter to filter events before root window process event
Factor out CursorManager from RootWindowEventFilter
Review URL: https://chromiumcodereview.appspot.com/10444107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140714 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/tooltips')
-rw-r--r-- | ash/tooltips/tooltip_controller.cc | 4 | ||||
-rw-r--r-- | ash/tooltips/tooltip_controller_unittest.cc | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc index bb0f55e..368603d 100644 --- a/ash/tooltips/tooltip_controller.cc +++ b/ash/tooltips/tooltip_controller.cc @@ -13,6 +13,8 @@ #include "base/string_split.h" #include "base/time.h" #include "ui/aura/client/drag_drop_client.h" +#include "ui/aura/cursor_manager.h" +#include "ui/aura/env.h" #include "ui/aura/event.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" @@ -375,7 +377,7 @@ void TooltipController::TooltipTimerFired() { void TooltipController::UpdateIfRequired() { if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress() || - !Shell::GetPrimaryRootWindow()->cursor_shown()) { + !aura::Env::GetInstance()->cursor_manager()->cursor_visible()) { tooltip_->Hide(); return; } diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc index 5cb972d5..1665f1a 100644 --- a/ash/tooltips/tooltip_controller_unittest.cc +++ b/ash/tooltips/tooltip_controller_unittest.cc @@ -7,6 +7,8 @@ #include "ash/tooltips/tooltip_controller.h" #include "base/utf_string_conversions.h" #include "ui/aura/client/tooltip_client.h" +#include "ui/aura/cursor_manager.h" +#include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" @@ -244,12 +246,12 @@ TEST_F(TooltipControllerTest, HideTooltipWhenCursorHidden) { EXPECT_TRUE(IsTooltipVisible()); // Hide the cursor and check again. - Shell::GetPrimaryRootWindow()->ShowCursor(false); + aura::Env::GetInstance()->cursor_manager()->ShowCursor(false); FireTooltipTimer(); EXPECT_FALSE(IsTooltipVisible()); // Show the cursor and re-check. - Shell::GetPrimaryRootWindow()->ShowCursor(true); + aura::Env::GetInstance()->cursor_manager()->ShowCursor(true); FireTooltipTimer(); EXPECT_TRUE(IsTooltipVisible()); } |