Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: chrome/browser/ui/ash/ash_init.cc

Issue 23904025: Move IsRunningOnChromeOS to SysInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/brightness_controller_chromeos.h" 28 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h"
29 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" 29 #include "chrome/browser/ui/ash/ime_controller_chromeos.h"
30 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 30 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
31 #include "chromeos/chromeos_switches.h" 31 #include "chromeos/chromeos_switches.h"
32 #include "chromeos/login/login_state.h" 32 #include "chromeos/login/login_state.h"
33 #include "ui/base/x/x11_util.h" 33 #include "ui/base/x/x11_util.h"
34 #endif 34 #endif
35 35
36 namespace chrome { 36 namespace chrome {
37 37
38 bool ShouldOpenAshOnStartup() { 38 bool ShouldOpenAshOnStartup() {
39 #if defined(OS_CHROMEOS) 39 #if defined(OS_CHROMEOS)
40 return true; 40 return true;
41 #endif 41 #endif
42 // TODO(scottmg): http://crbug.com/133312, will need this for Win8 too. 42 // TODO(scottmg): http://crbug.com/133312, will need this for Win8 too.
43 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh); 43 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh);
44 } 44 }
45 45
46 void OpenAsh() { 46 void OpenAsh() {
47 #if defined(OS_CHROMEOS) 47 #if defined(OS_CHROMEOS)
48 if (base::chromeos::IsRunningOnChromeOS()) { 48 if (base::SysInfo::IsRunningOnChromeOS()) {
49 // Hides the cursor outside of the Aura root window. The cursor will be 49 // Hides the cursor outside of the Aura root window. The cursor will be
50 // drawn within the Aura root window, and it'll remain hidden after the 50 // drawn within the Aura root window, and it'll remain hidden after the
51 // Aura window is closed. 51 // Aura window is closed.
52 ui::HideHostCursor(); 52 ui::HideHostCursor();
53 } 53 }
54 54
55 // Hide the mouse cursor completely at boot. 55 // Hide the mouse cursor completely at boot.
56 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) 56 if (!chromeos::LoginState::Get()->IsUserLoggedIn())
57 ash::Shell::set_initially_hide_cursor(true); 57 ash::Shell::set_initially_hide_cursor(true);
58 #endif 58 #endif
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void CloseAsh() { 93 void CloseAsh() {
94 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't 94 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't
95 // try to cleanup resources. 95 // try to cleanup resources.
96 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && 96 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
97 ash::Shell::HasInstance()) { 97 ash::Shell::HasInstance()) {
98 ash::Shell::DeleteInstance(); 98 ash::Shell::DeleteInstance();
99 } 99 }
100 } 100 }
101 101
102 } // namespace chrome 102 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698