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/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/wm/event_rewriter_event_filter.h" | 12 #include "ash/wm/event_rewriter_event_filter.h" |
13 #include "ash/wm/property_util.h" | 13 #include "ash/wm/property_util.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
16 #include "chrome/browser/lifetime/application_lifetime.h" | 16 #include "chrome/browser/lifetime/application_lifetime.h" |
17 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 17 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
18 #include "chrome/browser/ui/ash/event_rewriter.h" | 18 #include "chrome/browser/ui/ash/event_rewriter.h" |
19 #include "chrome/browser/ui/ash/screenshot_taker.h" | 19 #include "chrome/browser/ui/ash/screenshot_taker.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "ui/aura/aura_switches.h" | 21 #include "ui/aura/aura_switches.h" |
22 #include "ui/aura/display_manager.h" | 22 #include "ui/aura/display_util.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 #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/volume_controller_chromeos.h" | 32 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
(...skipping 16 matching lines...) Expand all Loading... |
49 | 49 |
50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
51 if (base::chromeos::IsRunningOnChromeOS()) { | 51 if (base::chromeos::IsRunningOnChromeOS()) { |
52 use_fullscreen = true; | 52 use_fullscreen = true; |
53 // Hides the cursor outside of the Aura root window. The cursor will be | 53 // Hides the cursor outside of the Aura root window. The cursor will be |
54 // drawn within the Aura root window, and it'll remain hidden after the | 54 // drawn within the Aura root window, and it'll remain hidden after the |
55 // Aura window is closed. | 55 // Aura window is closed. |
56 ui::HideHostCursor(); | 56 ui::HideHostCursor(); |
57 } | 57 } |
58 #endif | 58 #endif |
59 | |
60 if (use_fullscreen) { | 59 if (use_fullscreen) { |
61 aura::DisplayManager::set_use_fullscreen_host_window(true); | 60 aura::SetUseFullscreenHostWindow(true); |
62 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
63 // Hide the mouse cursor completely at boot. | 62 // Hide the mouse cursor completely at boot. |
64 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) | 63 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) |
65 ash::Shell::set_initially_hide_cursor(true); | 64 ash::Shell::set_initially_hide_cursor(true); |
66 #endif | 65 #endif |
67 } | 66 } |
68 | |
69 // Its easier to mark all windows as persisting and exclude the ones we care | 67 // Its easier to mark all windows as persisting and exclude the ones we care |
70 // about (browser windows), rather than explicitly excluding certain windows. | 68 // about (browser windows), rather than explicitly excluding certain windows. |
71 ash::SetDefaultPersistsAcrossAllWorkspaces(true); | 69 ash::SetDefaultPersistsAcrossAllWorkspaces(true); |
72 | 70 |
73 // Shell takes ownership of ChromeShellDelegate. | 71 // Shell takes ownership of ChromeShellDelegate. |
74 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 72 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
75 shell->event_rewriter_filter()->SetEventRewriterDelegate( | 73 shell->event_rewriter_filter()->SetEventRewriterDelegate( |
76 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); | 74 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); |
77 shell->accelerator_controller()->SetScreenshotDelegate( | 75 shell->accelerator_controller()->SetScreenshotDelegate( |
78 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 76 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
(...skipping 16 matching lines...) Expand all Loading... |
95 #endif | 93 #endif |
96 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 94 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
97 } | 95 } |
98 | 96 |
99 void CloseAsh() { | 97 void CloseAsh() { |
100 if (ash::Shell::HasInstance()) | 98 if (ash::Shell::HasInstance()) |
101 ash::Shell::DeleteInstance(); | 99 ash::Shell::DeleteInstance(); |
102 } | 100 } |
103 | 101 |
104 } // namespace chrome | 102 } // namespace chrome |
OLD | NEW |