Commit ddd9e9df authored by mazda@chromium.org's avatar mazda@chromium.org

Remove CursorManager::cursor_visible(), which is no longer necessary.

BUG=153703

Review URL: https://codereview.chromium.org/11419274

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170884 0039d316-1c4b-4281-b951-d872f2087c98
parent 4c0f86e2
......@@ -433,7 +433,7 @@ void TooltipController::TooltipShownTimerFired() {
void TooltipController::UpdateIfRequired() {
if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress() ||
!ash::Shell::GetInstance()->cursor_manager()->cursor_visible()) {
!ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible()) {
GetTooltip()->Hide();
return;
}
......
......@@ -30,9 +30,6 @@ class ASH_EXPORT CursorManager : public aura::client::CursorClient {
bool is_cursor_locked() const { return cursor_lock_count_ > 0; }
// Shows or hides the cursor.
bool cursor_visible() const { return cursor_visible_; }
// Overridden from aura::client::CursorClient:
virtual void SetCursor(gfx::NativeCursor) OVERRIDE;
virtual void ShowCursor(bool show) OVERRIDE;
......
......@@ -64,48 +64,48 @@ TEST_F(CursorManagerTest, ShowCursor) {
EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
cursor_manager->ShowCursor(true);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
cursor_manager->ShowCursor(false);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
// The current cursor does not change even when the cursor is not shown.
EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
// Check if cursor visibility is locked.
cursor_manager->LockCursor();
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
cursor_manager->ShowCursor(true);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
cursor_manager->UnlockCursor();
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
cursor_manager->LockCursor();
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
cursor_manager->ShowCursor(false);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
cursor_manager->UnlockCursor();
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
// Checks setting visiblity while cursor is locked does not affect the
// subsequent uses of UnlockCursor.
cursor_manager->LockCursor();
cursor_manager->ShowCursor(false);
cursor_manager->UnlockCursor();
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
cursor_manager->ShowCursor(true);
cursor_manager->LockCursor();
cursor_manager->UnlockCursor();
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
cursor_manager->LockCursor();
cursor_manager->ShowCursor(true);
cursor_manager->UnlockCursor();
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
cursor_manager->ShowCursor(false);
cursor_manager->LockCursor();
cursor_manager->UnlockCursor();
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
}
TEST_F(CursorManagerTest, SetDeviceScaleFactor) {
......
......@@ -25,7 +25,7 @@ namespace ash {
namespace test {
namespace {
bool cursor_visible() {
return ash::Shell::GetInstance()->cursor_manager()->cursor_visible();
return ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible();
}
}
......
......@@ -25,7 +25,7 @@ namespace ash {
namespace test {
namespace {
bool cursor_visible() {
return ash::Shell::GetInstance()->cursor_manager()->cursor_visible();
return ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible();
}
void CheckCalledCallback(bool* flag) {
......
......@@ -651,36 +651,36 @@ TEST_F(WindowManagerTest, UpdateCursorVisibility) {
ui::ET_TOUCH_RELEASED, gfx::Point(0, 0), 1, getTime());
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed1);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released1);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
// If someone else made cursor invisible keep it invisible even after it
// received mouse events.
cursor_manager->ShowCursor(false);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
// Back to normal.
cursor_manager->ShowCursor(true);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2);
EXPECT_FALSE(cursor_manager->cursor_visible());
EXPECT_FALSE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2);
EXPECT_TRUE(cursor_manager->cursor_visible());
EXPECT_TRUE(cursor_manager->IsCursorVisible());
}
} // namespace ash
......@@ -99,7 +99,7 @@ IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) {
// Verifies the cursor is not hidden at startup when user is logged in.
IN_PROC_BROWSER_TEST_F(LoginUserTest, CursorShown) {
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
}
// After a guest login, we should get the OTR default profile.
......@@ -113,7 +113,7 @@ IN_PROC_BROWSER_TEST_F(LoginGuestTest, GuestIsOTR) {
// Verifies the cursor is not hidden at startup when running guest session.
IN_PROC_BROWSER_TEST_F(LoginGuestTest, CursorShown) {
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
}
// Verifies the cursor is hidden at startup on login screen.
......@@ -122,11 +122,11 @@ IN_PROC_BROWSER_TEST_F(LoginCursorTest, CursorHidden) {
ShowLoginWizard(WizardController::kLoginScreenName, gfx::Size());
// Cursor should be hidden at startup
EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
// Cursor should be shown after cursor is moved.
EXPECT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point()));
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
MessageLoop::current()->DeleteSoon(FROM_HERE,
BaseLoginDisplayHost::default_host());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment