Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: chrome/browser/ui/ash/ash_init.cc

Issue 11364003: Fix the issue of cursor being shown at startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add tests Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/login_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/ash_init.cc
diff --git a/chrome/browser/ui/ash/ash_init.cc b/chrome/browser/ui/ash/ash_init.cc
index 241bfc6ff6f96914749fde17cc3ea88c61414479..0e0f2dbe3d81512e9682ca8d716f191a40a16bc9 100644
--- a/chrome/browser/ui/ash/ash_init.cc
+++ b/chrome/browser/ui/ash/ash_init.cc
@@ -44,6 +44,16 @@ bool ShouldOpenAshOnStartup() {
return false;
}
+#if defined(OS_CHROMEOS)
+// Returns true if the cursor should be initially hidden.
+bool ShouldInitiallyHideCursor() {
+ if (base::chromeos::IsRunningOnChromeOS())
+ return !chromeos::UserManager::Get()->IsUserLoggedIn();
+ else
+ return CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager);
+}
+#endif
+
void OpenAsh() {
bool use_fullscreen = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAuraHostWindowUseFullscreen);
@@ -56,15 +66,15 @@ void OpenAsh() {
// Aura window is closed.
ui::HideHostCursor();
}
+
+ // Hide the mouse cursor completely at boot.
+ if (ShouldInitiallyHideCursor())
+ ash::Shell::set_initially_hide_cursor(true);
#endif
- if (use_fullscreen) {
+
+ if (use_fullscreen)
aura::SetUseFullscreenHostWindow(true);
-#if defined(OS_CHROMEOS)
- // Hide the mouse cursor completely at boot.
- if (!chromeos::UserManager::Get()->IsUserLoggedIn())
- ash::Shell::set_initially_hide_cursor(true);
-#endif
- }
+
// Its easier to mark all windows as persisting and exclude the ones we care
// about (browser windows), rather than explicitly excluding certain windows.
ash::SetDefaultPersistsAcrossAllWorkspaces(true);
« no previous file with comments | « chrome/browser/chromeos/login/login_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698