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/root_window.h" | 24 #include "ui/aura/root_window.h" |
25 #include "ui/compositor/compositor_setup.h" | 25 #include "ui/compositor/compositor_setup.h" |
26 | 26 |
27 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
28 #include "base/chromeos/chromeos_version.h" | 28 #include "base/chromeos/chromeos_version.h" |
29 #include "chrome/browser/chromeos/login/user_manager.h" | 29 #include "chrome/browser/chromeos/login/user_manager.h" |
30 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h" | 30 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h" |
31 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 31 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
32 #include "chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h" | 32 #include "chrome/browser/ui/ash/keyboard_brightness_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 "ui/base/x/x11_util.h" |
34 #endif | 35 #endif |
35 | 36 |
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 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); | 44 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); |
44 } | 45 } |
45 | 46 |
46 void OpenAsh() { | 47 void OpenAsh() { |
47 bool use_fullscreen = CommandLine::ForCurrentProcess()->HasSwitch( | 48 bool use_fullscreen = CommandLine::ForCurrentProcess()->HasSwitch( |
48 switches::kAuraHostWindowUseFullscreen); | 49 switches::kAuraHostWindowUseFullscreen); |
49 | 50 |
50 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
51 if (base::chromeos::IsRunningOnChromeOS()) | 52 if (base::chromeos::IsRunningOnChromeOS()) { |
52 use_fullscreen = true; | 53 use_fullscreen = true; |
| 54 // Hides the cursor outside of the Aura root window. The cursor will be |
| 55 // drawn within the Aura root window, and it'll remain hidden after the |
| 56 // Aura window is closed. |
| 57 ui::HideHostCursor(); |
| 58 } |
53 #endif | 59 #endif |
54 | 60 |
55 if (use_fullscreen) { | 61 if (use_fullscreen) { |
56 aura::DisplayManager::set_use_fullscreen_host_window(true); | 62 aura::DisplayManager::set_use_fullscreen_host_window(true); |
57 #if defined(OS_CHROMEOS) | 63 #if defined(OS_CHROMEOS) |
58 aura::RootWindow::set_hide_host_cursor(true); | |
59 // Hide the mouse cursor completely at boot. | 64 // Hide the mouse cursor completely at boot. |
60 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) | 65 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) |
61 ash::Shell::set_initially_hide_cursor(true); | 66 ash::Shell::set_initially_hide_cursor(true); |
62 #endif | 67 #endif |
63 } | 68 } |
64 | 69 |
65 // Its easier to mark all windows as persisting and exclude the ones we care | 70 // Its easier to mark all windows as persisting and exclude the ones we care |
66 // about (browser windows), rather than explicitly excluding certain windows. | 71 // about (browser windows), rather than explicitly excluding certain windows. |
67 ash::SetDefaultPersistsAcrossAllWorkspaces(true); | 72 ash::SetDefaultPersistsAcrossAllWorkspaces(true); |
68 | 73 |
(...skipping 25 matching lines...) Expand all Loading... |
94 #endif | 99 #endif |
95 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 100 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
96 } | 101 } |
97 | 102 |
98 void CloseAsh() { | 103 void CloseAsh() { |
99 if (ash::Shell::GetInstance()) | 104 if (ash::Shell::GetInstance()) |
100 ash::Shell::DeleteInstance(); | 105 ash::Shell::DeleteInstance(); |
101 } | 106 } |
102 | 107 |
103 } // namespace chrome | 108 } // namespace chrome |
OLD | NEW |