OLD | NEW |
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 14 matching lines...) Expand all Loading... |
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" | 31 #include "chrome/browser/chromeos/login/user_manager.h" |
32 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h" | 32 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h" |
33 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 33 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
34 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 34 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
| 35 #include "chromeos/chromeos_switches.h" |
35 #include "ui/base/x/x11_util.h" | 36 #include "ui/base/x/x11_util.h" |
36 #endif | 37 #endif |
37 | 38 |
38 namespace chrome { | 39 namespace chrome { |
39 | 40 |
40 bool ShouldOpenAshOnStartup() { | 41 bool ShouldOpenAshOnStartup() { |
41 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
42 return true; | 43 return true; |
43 #endif | 44 #endif |
44 // 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. |
45 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); | 46 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); |
46 } | 47 } |
47 | 48 |
48 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
49 // Returns true if the cursor should be initially hidden. | 50 // Returns true if the cursor should be initially hidden. |
50 bool ShouldInitiallyHideCursor() { | 51 bool ShouldInitiallyHideCursor() { |
51 if (base::chromeos::IsRunningOnChromeOS()) | 52 if (base::chromeos::IsRunningOnChromeOS()) |
52 return !chromeos::UserManager::Get()->IsUserLoggedIn(); | 53 return !chromeos::UserManager::Get()->IsUserLoggedIn(); |
53 else | 54 else |
54 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager); | 55 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 56 chromeos::switches::kLoginManager); |
55 } | 57 } |
56 #endif | 58 #endif |
57 | 59 |
58 void OpenAsh() { | 60 void OpenAsh() { |
59 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
60 if (base::chromeos::IsRunningOnChromeOS()) { | 62 if (base::chromeos::IsRunningOnChromeOS()) { |
61 // Hides the cursor outside of the Aura root window. The cursor will be | 63 // Hides the cursor outside of the Aura root window. The cursor will be |
62 // drawn within the Aura root window, and it'll remain hidden after the | 64 // drawn within the Aura root window, and it'll remain hidden after the |
63 // Aura window is closed. | 65 // Aura window is closed. |
64 ui::HideHostCursor(); | 66 ui::HideHostCursor(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 void CloseAsh() { | 113 void CloseAsh() { |
112 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 114 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
113 // try to cleanup resources. | 115 // try to cleanup resources. |
114 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 116 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
115 ash::Shell::HasInstance()) { | 117 ash::Shell::HasInstance()) { |
116 ash::Shell::DeleteInstance(); | 118 ash::Shell::DeleteInstance(); |
117 } | 119 } |
118 } | 120 } |
119 | 121 |
120 } // namespace chrome | 122 } // namespace chrome |
OLD | NEW |