| 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" |
| 11 #include "ash/magnifier/partial_magnification_controller.h" | 11 #include "ash/magnifier/partial_magnification_controller.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/wm/event_rewriter_event_filter.h" | 13 #include "ash/wm/event_rewriter_event_filter.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "chrome/browser/browser_shutdown.h" | 15 #include "chrome/browser/browser_shutdown.h" |
| 16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 17 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 17 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 18 #include "chrome/browser/lifetime/application_lifetime.h" | 18 #include "chrome/browser/lifetime/application_lifetime.h" |
| 19 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 19 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 20 #include "chrome/browser/ui/ash/event_rewriter.h" | 20 #include "chrome/browser/ui/ash/event_rewriter.h" |
| 21 #include "chrome/browser/ui/ash/screenshot_taker.h" | 21 #include "chrome/browser/ui/ash/screenshot_taker.h" |
| 22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 23 #include "ui/aura/env.h" | 23 #include "ui/aura/env.h" |
| 24 #include "ui/aura/root_window.h" | 24 #include "ui/aura/root_window.h" |
| 25 | 25 |
| 26 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| 27 #include "base/chromeos/chromeos_version.h" | 27 #include "base/sys_info.h" |
| 28 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 28 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
| 29 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 29 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
| 30 #include "chromeos/chromeos_switches.h" | 30 #include "chromeos/chromeos_switches.h" |
| 31 #include "chromeos/login/login_state.h" | 31 #include "chromeos/login/login_state.h" |
| 32 #include "ui/base/x/x11_util.h" | 32 #include "ui/base/x/x11_util.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 namespace chrome { | 35 namespace chrome { |
| 36 | 36 |
| 37 bool ShouldOpenAshOnStartup() { | 37 bool ShouldOpenAshOnStartup() { |
| 38 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
| 39 return true; | 39 return true; |
| 40 #endif | 40 #endif |
| 41 // TODO(scottmg): http://crbug.com/133312, will need this for Win8 too. | 41 // TODO(scottmg): http://crbug.com/133312, will need this for Win8 too. |
| 42 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); | 42 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void OpenAsh() { | 45 void OpenAsh() { |
| 46 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| 47 if (base::chromeos::IsRunningOnChromeOS()) { | 47 if (base::SysInfo::IsRunningOnChromeOS()) { |
| 48 // Hides the cursor outside of the Aura root window. The cursor will be | 48 // Hides the cursor outside of the Aura root window. The cursor will be |
| 49 // drawn within the Aura root window, and it'll remain hidden after the | 49 // drawn within the Aura root window, and it'll remain hidden after the |
| 50 // Aura window is closed. | 50 // Aura window is closed. |
| 51 ui::HideHostCursor(); | 51 ui::HideHostCursor(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // Hide the mouse cursor completely at boot. | 54 // Hide the mouse cursor completely at boot. |
| 55 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) | 55 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) |
| 56 ash::Shell::set_initially_hide_cursor(true); | 56 ash::Shell::set_initially_hide_cursor(true); |
| 57 #endif | 57 #endif |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void CloseAsh() { | 89 void CloseAsh() { |
| 90 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 90 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
| 91 // try to cleanup resources. | 91 // try to cleanup resources. |
| 92 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 92 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
| 93 ash::Shell::HasInstance()) { | 93 ash::Shell::HasInstance()) { |
| 94 ash::Shell::DeleteInstance(); | 94 ash::Shell::DeleteInstance(); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace chrome | 98 } // namespace chrome |
| OLD | NEW |