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 11 matching lines...) Expand all Loading... |
22 #include "ui/aura/aura_switches.h" | 22 #include "ui/aura/aura_switches.h" |
23 #include "ui/aura/display_manager.h" | 23 #include "ui/aura/display_manager.h" |
24 #include "ui/aura/env.h" | 24 #include "ui/aura/env.h" |
25 #include "ui/aura/root_window.h" | 25 #include "ui/aura/root_window.h" |
26 #include "ui/compositor/compositor_setup.h" | 26 #include "ui/compositor/compositor_setup.h" |
27 | 27 |
28 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
29 #include "base/chromeos/chromeos_version.h" | 29 #include "base/chromeos/chromeos_version.h" |
30 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 30 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
31 #include "chrome/browser/chromeos/login/user_manager.h" | 31 #include "chrome/browser/chromeos/login/user_manager.h" |
32 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | |
33 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h" | 32 #include "chrome/browser/ui/ash/brightness_controller_chromeos.h" |
34 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 33 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
35 #include "chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h" | 34 #include "chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h" |
36 #endif | 35 #endif |
37 | 36 |
38 | 37 |
39 namespace chrome { | 38 namespace chrome { |
40 | 39 |
41 bool ShouldOpenAshOnStartup() { | 40 bool ShouldOpenAshOnStartup() { |
42 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 new BrightnessController).Pass()); | 79 new BrightnessController).Pass()); |
81 chromeos::input_method::XKeyboard* xkeyboard = | 80 chromeos::input_method::XKeyboard* xkeyboard = |
82 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard(); | 81 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard(); |
83 shell->accelerator_controller()->SetCapsLockDelegate( | 82 shell->accelerator_controller()->SetCapsLockDelegate( |
84 scoped_ptr<ash::CapsLockDelegate>(new CapsLockHandler(xkeyboard)).Pass()); | 83 scoped_ptr<ash::CapsLockDelegate>(new CapsLockHandler(xkeyboard)).Pass()); |
85 shell->accelerator_controller()->SetImeControlDelegate( | 84 shell->accelerator_controller()->SetImeControlDelegate( |
86 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 85 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
87 shell->accelerator_controller()->SetKeyboardBrightnessControlDelegate( | 86 shell->accelerator_controller()->SetKeyboardBrightnessControlDelegate( |
88 scoped_ptr<ash::KeyboardBrightnessControlDelegate>( | 87 scoped_ptr<ash::KeyboardBrightnessControlDelegate>( |
89 new KeyboardBrightnessController).Pass()); | 88 new KeyboardBrightnessController).Pass()); |
90 shell->accelerator_controller()->SetVolumeControlDelegate( | |
91 scoped_ptr<ash::VolumeControlDelegate>(new VolumeController).Pass()); | |
92 | |
93 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( | 89 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( |
94 chromeos::accessibility::IsHighContrastEnabled()); | 90 chromeos::accessibility::IsHighContrastEnabled()); |
95 | 91 |
96 ash::Shell::GetInstance()->magnification_controller()->SetEnabled( | 92 ash::Shell::GetInstance()->magnification_controller()->SetEnabled( |
97 chromeos::accessibility::IsScreenMagnifierEnabled()); | 93 chromeos::accessibility::IsScreenMagnifierEnabled()); |
98 | 94 |
99 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 95 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
100 switches::kDisableZeroBrowsersOpenForTests)) { | 96 switches::kDisableZeroBrowsersOpenForTests)) { |
101 browser::StartKeepAlive(); | 97 browser::StartKeepAlive(); |
102 } | 98 } |
103 #endif | 99 #endif |
104 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 100 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
105 } | 101 } |
106 | 102 |
107 void CloseAsh() { | 103 void CloseAsh() { |
108 if (ash::Shell::GetInstance()) | 104 if (ash::Shell::GetInstance()) |
109 ash::Shell::DeleteInstance(); | 105 ash::Shell::DeleteInstance(); |
110 } | 106 } |
111 | 107 |
112 } // namespace chrome | 108 } // namespace chrome |
OLD | NEW |