summaryrefslogtreecommitdiffstats
path: root/ash/test
diff options
context:
space:
mode:
authormazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-19 16:43:53 +0000
committermazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-19 16:43:53 +0000
commit166ccde782c9603bfda23edd922d467a47f08cef (patch)
treefb2881a992d43b954927071812d78e77bb5ffccc /ash/test
parentf5e8479e80f090dd1a95e701bb1f38de6718523b (diff)
downloadchromium_src-166ccde782c9603bfda23edd922d467a47f08cef.zip
chromium_src-166ccde782c9603bfda23edd922d467a47f08cef.tar.gz
chromium_src-166ccde782c9603bfda23edd922d467a47f08cef.tar.bz2
Make the cursor have separate mode for disabled mouse events and invisible.
This CL adds the following APIs. * CursorClient::DisableMouseEvents: Makes mouse events stop being sent and hides the cursor if it is visible. (For now, DisableMouseEvents just clears the hover state and doesn't prevent mouse events from being generated, though). * CursorClient::EnableMouseEvents: Makes mouse events start being sent and shows the cursor if it was hidden with DisableMouseEvents. * CursorClient::HideCursor: Makes the cursor invisible. This changes only the cursor visibility and mouse events keep being sent even when the cursor is invisible. * CursorClient::ShowCursor: Makes the cursor visible. This does not take effect When mouse events are disabled. This CL just replaces the old usages of CursorClient::ShowCursor with the new APIs to retain existing behavior. I'll make another CL that uses these APIs in appropriate places. BUG=153703 TEST=CursorManagerTest.EnableDisableMouseEvents, CursorManagerTest.ShowAndEnable Review URL: https://chromiumcodereview.appspot.com/11412315 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r--ash/test/ash_test_base.cc2
-rw-r--r--ash/test/cursor_manager_test_api.cc6
-rw-r--r--ash/test/cursor_manager_test_api.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index f308e69..b9da0d7 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -65,7 +65,7 @@ void AshTestBase::SetUp() {
// Move the mouse cursor to far away so that native events doesn't
// interfere test expectations.
Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
- Shell::GetInstance()->cursor_manager()->ShowCursor(true);
+ Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
}
void AshTestBase::TearDown() {
diff --git a/ash/test/cursor_manager_test_api.cc b/ash/test/cursor_manager_test_api.cc
index e992f9c..bd24b0d 100644
--- a/ash/test/cursor_manager_test_api.cc
+++ b/ash/test/cursor_manager_test_api.cc
@@ -17,11 +17,11 @@ CursorManagerTestApi::CursorManagerTestApi(CursorManager* cursor_manager)
CursorManagerTestApi::~CursorManagerTestApi() {
}
-gfx::NativeCursor CursorManagerTestApi::GetCurrentCursor() {
- return cursor_manager_->current_cursor_;
+gfx::NativeCursor CursorManagerTestApi::GetCurrentCursor() const {
+ return cursor_manager_->GetCurrentCursor();
}
-float CursorManagerTestApi::GetDeviceScaleFactor() {
+float CursorManagerTestApi::GetDeviceScaleFactor() const {
return cursor_manager_->image_cursors_->GetDeviceScaleFactor();
}
diff --git a/ash/test/cursor_manager_test_api.h b/ash/test/cursor_manager_test_api.h
index 5cb25ad..73a6e4c 100644
--- a/ash/test/cursor_manager_test_api.h
+++ b/ash/test/cursor_manager_test_api.h
@@ -20,8 +20,8 @@ class CursorManagerTestApi {
explicit CursorManagerTestApi(CursorManager* cursor_manager);
~CursorManagerTestApi();
- gfx::NativeCursor GetCurrentCursor();
- float GetDeviceScaleFactor();
+ gfx::NativeCursor GetCurrentCursor() const;
+ float GetDeviceScaleFactor() const;
private:
CursorManager* cursor_manager_;