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