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

Side by Side Diff: chrome/browser/ui/ash/ash_init.cc

Issue 13495003: Add LoginState class to src/chromeos/login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/ash_init.h" 5 #include "chrome/browser/ui/ash/ash_init.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/high_contrast/high_contrast_controller.h" 9 #include "ash/high_contrast/high_contrast_controller.h"
10 #include "ash/magnifier/magnification_controller.h" 10 #include "ash/magnifier/magnification_controller.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 21 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
22 #include "chrome/browser/ui/ash/event_rewriter.h" 22 #include "chrome/browser/ui/ash/event_rewriter.h"
23 #include "chrome/browser/ui/ash/screenshot_taker.h" 23 #include "chrome/browser/ui/ash/screenshot_taker.h"
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
25 #include "ui/aura/env.h" 25 #include "ui/aura/env.h"
26 #include "ui/aura/root_window.h" 26 #include "ui/aura/root_window.h"
27 #include "ui/compositor/compositor_setup.h" 27 #include "ui/compositor/compositor_setup.h"
28 28
29 #if defined(OS_CHROMEOS) 29 #if defined(OS_CHROMEOS)
30 #include "base/chromeos/chromeos_version.h" 30 #include "base/chromeos/chromeos_version.h"
31 #include "chrome/browser/chromeos/login/user_manager.h"
32 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h" 31 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h"
33 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" 32 #include "chrome/browser/ui/ash/ime_controller_chromeos.h"
34 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 33 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
35 #include "chromeos/chromeos_switches.h" 34 #include "chromeos/chromeos_switches.h"
35 #include "chromeos/login/login_state.h"
36 #include "ui/base/x/x11_util.h" 36 #include "ui/base/x/x11_util.h"
37 #endif 37 #endif
38 38
39 namespace chrome { 39 namespace chrome {
40 40
41 bool ShouldOpenAshOnStartup() { 41 bool ShouldOpenAshOnStartup() {
42 #if defined(OS_CHROMEOS) 42 #if defined(OS_CHROMEOS)
43 return true; 43 return true;
44 #endif 44 #endif
45 // TODO(scottmg): http://crbug.com/133312, will need this for Win8 too. 45 // TODO(scottmg): http://crbug.com/133312, will need this for Win8 too.
46 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); 46 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh);
47 } 47 }
48 48
49 #if defined(OS_CHROMEOS)
50 // Returns true if the cursor should be initially hidden.
51 bool ShouldInitiallyHideCursor() {
52 if (base::chromeos::IsRunningOnChromeOS())
53 return !chromeos::UserManager::Get()->IsUserLoggedIn();
54 else
55 return CommandLine::ForCurrentProcess()->HasSwitch(
56 chromeos::switches::kLoginManager);
57 }
58 #endif
59
60 void OpenAsh() { 49 void OpenAsh() {
61 #if defined(OS_CHROMEOS) 50 #if defined(OS_CHROMEOS)
62 if (base::chromeos::IsRunningOnChromeOS()) { 51 if (base::chromeos::IsRunningOnChromeOS()) {
63 // Hides the cursor outside of the Aura root window. The cursor will be 52 // Hides the cursor outside of the Aura root window. The cursor will be
64 // drawn within the Aura root window, and it'll remain hidden after the 53 // drawn within the Aura root window, and it'll remain hidden after the
65 // Aura window is closed. 54 // Aura window is closed.
66 ui::HideHostCursor(); 55 ui::HideHostCursor();
67 } 56 }
68 57
69 // Hide the mouse cursor completely at boot. 58 // Hide the mouse cursor completely at boot.
70 if (ShouldInitiallyHideCursor()) 59 if (!chromeos::LoginState::Get()->IsUserLoggedIn())
71 ash::Shell::set_initially_hide_cursor(true); 60 ash::Shell::set_initially_hide_cursor(true);
72 #endif 61 #endif
73 62
74 // Its easier to mark all windows as persisting and exclude the ones we care 63 // Its easier to mark all windows as persisting and exclude the ones we care
75 // about (browser windows), rather than explicitly excluding certain windows. 64 // about (browser windows), rather than explicitly excluding certain windows.
76 ash::SetDefaultPersistsAcrossAllWorkspaces(true); 65 ash::SetDefaultPersistsAcrossAllWorkspaces(true);
77 66
78 // Shell takes ownership of ChromeShellDelegate. 67 // Shell takes ownership of ChromeShellDelegate.
79 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); 68 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate);
80 shell->event_rewriter_filter()->SetEventRewriterDelegate( 69 shell->event_rewriter_filter()->SetEventRewriterDelegate(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void CloseAsh() { 102 void CloseAsh() {
114 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't 103 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't
115 // try to cleanup resources. 104 // try to cleanup resources.
116 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && 105 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
117 ash::Shell::HasInstance()) { 106 ash::Shell::HasInstance()) {
118 ash::Shell::DeleteInstance(); 107 ash::Shell::DeleteInstance();
119 } 108 }
120 } 109 }
121 110
122 } // namespace chrome 111 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/auth_service.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698