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