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/chrome_browser_main_extra_parts_ash.h" | 5 #include "chrome/browser/chrome_browser_main_extra_parts_ash.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/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
12 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" | 12 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" |
13 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" | 13 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" |
14 #include "chrome/browser/ui/views/ash/screen_orientation_listener.h" | 14 #include "chrome/browser/ui/views/ash/screen_orientation_listener.h" |
15 #include "chrome/browser/ui/views/ash/screenshot_taker.h" | 15 #include "chrome/browser/ui/views/ash/screenshot_taker.h" |
16 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" | 16 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" |
17 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
18 #include "ui/aura/aura_switches.h" | 18 #include "ui/aura/aura_switches.h" |
| 19 #include "ui/aura/monitor_manager.h" |
19 #include "ui/aura/root_window.h" | 20 #include "ui/aura/root_window.h" |
20 #include "ui/gfx/compositor/compositor_setup.h" | 21 #include "ui/gfx/compositor/compositor_setup.h" |
21 | 22 |
22 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
23 #include "base/chromeos/chromeos_version.h" | 24 #include "base/chromeos/chromeos_version.h" |
24 #include "chrome/browser/ui/views/ash/brightness_controller_chromeos.h" | 25 #include "chrome/browser/ui/views/ash/brightness_controller_chromeos.h" |
25 #include "chrome/browser/ui/views/ash/ime_controller_chromeos.h" | 26 #include "chrome/browser/ui/views/ash/ime_controller_chromeos.h" |
26 #include "chrome/browser/ui/views/ash/volume_controller_chromeos.h" | 27 #include "chrome/browser/ui/views/ash/volume_controller_chromeos.h" |
27 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 28 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
28 #include "chrome/browser/chromeos/login/user_manager.h" | 29 #include "chrome/browser/chromeos/login/user_manager.h" |
29 #endif | 30 #endif |
30 | 31 |
31 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() | 32 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() |
32 : ChromeBrowserMainExtraParts() { | 33 : ChromeBrowserMainExtraParts() { |
33 } | 34 } |
34 | 35 |
35 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { | 36 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { |
36 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 38 aura::MonitorManager::set_use_fullscreen_host_window(true); |
37 if (base::chromeos::IsRunningOnChromeOS() || | 39 if (base::chromeos::IsRunningOnChromeOS() || |
38 CommandLine::ForCurrentProcess()->HasSwitch( | 40 CommandLine::ForCurrentProcess()->HasSwitch( |
39 switches::kAuraHostWindowUseFullscreen)) { | 41 switches::kAuraHostWindowUseFullscreen)) { |
40 aura::RootWindow::set_use_fullscreen_host_window(true); | 42 aura::MonitorManager::set_use_fullscreen_host_window(true); |
41 aura::RootWindow::set_hide_host_cursor(true); | 43 aura::RootWindow::set_hide_host_cursor(true); |
42 // Hide the mouse cursor completely at boot. | 44 // Hide the mouse cursor completely at boot. |
43 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) | 45 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) |
44 ash::Shell::set_initially_hide_cursor(true); | 46 ash::Shell::set_initially_hide_cursor(true); |
45 } | 47 } |
46 #endif | 48 #endif |
47 | 49 |
48 // Shell takes ownership of ChromeShellDelegate. | 50 // Shell takes ownership of ChromeShellDelegate. |
49 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 51 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
50 shell->accelerator_controller()->SetScreenshotDelegate( | 52 shell->accelerator_controller()->SetScreenshotDelegate( |
(...skipping 20 matching lines...) Expand all Loading... |
71 // Add the status area buttons after Profile has been initialized. | 73 // Add the status area buttons after Profile has been initialized. |
72 if (CommandLine::ForCurrentProcess()->HasSwitch( | 74 if (CommandLine::ForCurrentProcess()->HasSwitch( |
73 ash::switches::kDisableAshUberTray)) { | 75 ash::switches::kDisableAshUberTray)) { |
74 ChromeShellDelegate::instance()->status_area_host()->AddButtons(); | 76 ChromeShellDelegate::instance()->status_area_host()->AddButtons(); |
75 } | 77 } |
76 } | 78 } |
77 | 79 |
78 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { | 80 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { |
79 ash::Shell::DeleteInstance(); | 81 ash::Shell::DeleteInstance(); |
80 } | 82 } |
OLD | NEW |