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/views/ash/chrome_browser_main_extra_parts_ash.h" | 5 #include "chrome/browser/ui/views/ash/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/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "chrome/browser/ui/views/ash/volume_controller_chromeos.h" | 35 #include "chrome/browser/ui/views/ash/volume_controller_chromeos.h" |
36 #endif | 36 #endif |
37 | 37 |
38 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() { | 38 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() { |
39 } | 39 } |
40 | 40 |
41 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() { | 41 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() { |
42 } | 42 } |
43 | 43 |
44 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { | 44 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { |
45 bool use_fullscreen = CommandLine::ForCurrentProcess()->HasSwitch( | |
46 switches::kAuraHostWindowUseFullscreen); | |
47 | |
45 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
46 if (base::chromeos::IsRunningOnChromeOS() || | 49 if (base::chromeos::IsRunningOnChromeOS()) |
47 CommandLine::ForCurrentProcess()->HasSwitch( | 50 use_fullscreen = true; |
48 switches::kAuraHostWindowUseFullscreen)) { | 51 #endif |
52 | |
53 if (use_fullscreen) { | |
49 aura::MonitorManager::set_use_fullscreen_host_window(true); | 54 aura::MonitorManager::set_use_fullscreen_host_window(true); |
50 aura::RootWindow::set_hide_host_cursor(true); | 55 aura::RootWindow::set_hide_host_cursor(true); |
Daniel Erat
2012/06/08 13:25:04
I think that this should probably be within the OS
| |
56 #if defined(OS_CHROMEOS) | |
51 // Hide the mouse cursor completely at boot. | 57 // Hide the mouse cursor completely at boot. |
52 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) | 58 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) |
53 ash::Shell::set_initially_hide_cursor(true); | 59 ash::Shell::set_initially_hide_cursor(true); |
60 #endif | |
54 } | 61 } |
55 #endif | |
56 | 62 |
57 // Its easier to mark all windows as persisting and exclude the ones we care | 63 // Its easier to mark all windows as persisting and exclude the ones we care |
58 // about (browser windows), rather than explicitly excluding certain windows. | 64 // about (browser windows), rather than explicitly excluding certain windows. |
59 ash::SetDefaultPersistsAcrossAllWorkspaces(true); | 65 ash::SetDefaultPersistsAcrossAllWorkspaces(true); |
60 | 66 |
61 // Shell takes ownership of ChromeShellDelegate. | 67 // Shell takes ownership of ChromeShellDelegate. |
62 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 68 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
63 shell->key_rewriter_filter()->SetKeyRewriterDelegate( | 69 shell->key_rewriter_filter()->SetKeyRewriterDelegate( |
64 scoped_ptr<ash::KeyRewriterDelegate>(new KeyRewriter).Pass()); | 70 scoped_ptr<ash::KeyRewriterDelegate>(new KeyRewriter).Pass()); |
65 shell->accelerator_controller()->SetScreenshotDelegate( | 71 shell->accelerator_controller()->SetScreenshotDelegate( |
(...skipping 29 matching lines...) Expand all Loading... | |
95 ash::Shell::DeleteInstance(); | 101 ash::Shell::DeleteInstance(); |
96 } | 102 } |
97 | 103 |
98 namespace browser { | 104 namespace browser { |
99 | 105 |
100 void AddAshToolkitExtraParts(ChromeBrowserMainParts* main_parts) { | 106 void AddAshToolkitExtraParts(ChromeBrowserMainParts* main_parts) { |
101 main_parts->AddParts(new ChromeBrowserMainExtraPartsAsh()); | 107 main_parts->AddParts(new ChromeBrowserMainExtraPartsAsh()); |
102 } | 108 } |
103 | 109 |
104 } // namespace browser | 110 } // namespace browser |
OLD | NEW |