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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 #include "ui/aura/window_event_dispatcher.h" | 149 #include "ui/aura/window_event_dispatcher.h" |
150 #include "ui/base/ui_base_switches.h" | 150 #include "ui/base/ui_base_switches.h" |
151 #include "ui/base/user_activity/user_activity_detector.h" | 151 #include "ui/base/user_activity/user_activity_detector.h" |
152 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 152 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
153 #include "ui/compositor/layer.h" | 153 #include "ui/compositor/layer.h" |
154 #include "ui/compositor/layer_animator.h" | 154 #include "ui/compositor/layer_animator.h" |
155 #include "ui/display/display.h" | 155 #include "ui/display/display.h" |
156 #include "ui/display/manager/chromeos/default_touch_transform_setter.h" | 156 #include "ui/display/manager/chromeos/default_touch_transform_setter.h" |
157 #include "ui/display/manager/chromeos/display_change_observer.h" | 157 #include "ui/display/manager/chromeos/display_change_observer.h" |
158 #include "ui/display/manager/chromeos/display_configurator.h" | 158 #include "ui/display/manager/chromeos/display_configurator.h" |
159 #include "ui/display/manager/chromeos/touch_transform_setter.h" | |
160 #include "ui/display/manager/display_manager.h" | 159 #include "ui/display/manager/display_manager.h" |
161 #include "ui/display/screen.h" | 160 #include "ui/display/screen.h" |
162 #include "ui/display/types/native_display_delegate.h" | 161 #include "ui/display/types/native_display_delegate.h" |
163 #include "ui/events/event_target_iterator.h" | 162 #include "ui/events/event_target_iterator.h" |
164 #include "ui/gfx/geometry/insets.h" | 163 #include "ui/gfx/geometry/insets.h" |
165 #include "ui/gfx/image/image_skia.h" | 164 #include "ui/gfx/image/image_skia.h" |
166 #include "ui/keyboard/keyboard_controller.h" | 165 #include "ui/keyboard/keyboard_controller.h" |
167 #include "ui/keyboard/keyboard_switches.h" | 166 #include "ui/keyboard/keyboard_switches.h" |
168 #include "ui/keyboard/keyboard_util.h" | 167 #include "ui/keyboard/keyboard_util.h" |
169 #include "ui/views/corewm/tooltip_aura.h" | 168 #include "ui/views/corewm/tooltip_aura.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 (Shell::GetAshConfig() == Config::MUS && | 319 (Shell::GetAshConfig() == Config::MUS && |
321 base::CommandLine::ForCurrentProcess()->HasSwitch( | 320 base::CommandLine::ForCurrentProcess()->HasSwitch( |
322 switches::kUseIMEService)); | 321 switches::kUseIMEService)); |
323 } | 322 } |
324 | 323 |
325 // static | 324 // static |
326 void Shell::RegisterPrefs(PrefRegistrySimple* registry) { | 325 void Shell::RegisterPrefs(PrefRegistrySimple* registry) { |
327 NightLightController::RegisterPrefs(registry); | 326 NightLightController::RegisterPrefs(registry); |
328 } | 327 } |
329 | 328 |
330 // static | |
331 bool Shell::ShouldEnableSimplifiedDisplayManagement() { | |
332 return GetAshConfig() != Config::MASH; | |
333 } | |
334 | |
335 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 329 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
336 views::Widget* widget) { | 330 views::Widget* widget) { |
337 // Use translucent-style window frames for dialogs. | 331 // Use translucent-style window frames for dialogs. |
338 return new CustomFrameViewAsh(widget); | 332 return new CustomFrameViewAsh(widget); |
339 } | 333 } |
340 | 334 |
341 void Shell::SetDisplayWorkAreaInsets(Window* contains, | 335 void Shell::SetDisplayWorkAreaInsets(Window* contains, |
342 const gfx::Insets& insets) { | 336 const gfx::Insets& insets) { |
343 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); | 337 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); |
344 } | 338 } |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 SetSystemTrayDelegate( | 1050 SetSystemTrayDelegate( |
1057 base::WrapUnique(shell_delegate_->CreateSystemTrayDelegate())); | 1051 base::WrapUnique(shell_delegate_->CreateSystemTrayDelegate())); |
1058 | 1052 |
1059 // May trigger initialization of the Bluetooth adapter. | 1053 // May trigger initialization of the Bluetooth adapter. |
1060 tray_bluetooth_helper_->Initialize(); | 1054 tray_bluetooth_helper_->Initialize(); |
1061 | 1055 |
1062 // Create AshTouchTransformController before | 1056 // Create AshTouchTransformController before |
1063 // WindowTreeHostManager::InitDisplays() | 1057 // WindowTreeHostManager::InitDisplays() |
1064 // since AshTouchTransformController listens on | 1058 // since AshTouchTransformController listens on |
1065 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). | 1059 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). |
1066 if (ShouldEnableSimplifiedDisplayManagement()) { | 1060 // TODO(sky): needs to to work for mus too. |
1067 touch_transformer_controller_ = | 1061 if (config == Config::CLASSIC) { |
1068 base::MakeUnique<AshTouchTransformController>( | 1062 touch_transformer_controller_.reset(new AshTouchTransformController( |
1069 display_configurator_.get(), display_manager_.get(), | 1063 display_configurator_.get(), display_manager_.get(), |
1070 shell_port_->CreateTouchTransformDelegate()); | 1064 base::MakeUnique<display::DefaultTouchTransformSetter>())); |
1071 } | 1065 } |
1072 | 1066 |
1073 keyboard_ui_ = shell_port_->CreateKeyboardUI(); | 1067 keyboard_ui_ = shell_port_->CreateKeyboardUI(); |
1074 | 1068 |
1075 shell_port_->InitHosts(init_params); | 1069 shell_port_->InitHosts(init_params); |
1076 | 1070 |
1077 // Needs to be created after InitDisplays() since it may cause the virtual | 1071 // Needs to be created after InitDisplays() since it may cause the virtual |
1078 // keyboard to be deployed. | 1072 // keyboard to be deployed. |
1079 if (config != Config::MASH) | 1073 if (config != Config::MASH) |
1080 virtual_keyboard_controller_.reset(new VirtualKeyboardController); | 1074 virtual_keyboard_controller_.reset(new VirtualKeyboardController); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 void Shell::OnPrefServiceInitialized( | 1266 void Shell::OnPrefServiceInitialized( |
1273 std::unique_ptr<::PrefService> pref_service) { | 1267 std::unique_ptr<::PrefService> pref_service) { |
1274 if (!instance_) | 1268 if (!instance_) |
1275 return; | 1269 return; |
1276 // |pref_service_| is null if can't connect to Chrome (as happens when | 1270 // |pref_service_| is null if can't connect to Chrome (as happens when |
1277 // running mash outside of chrome --mash and chrome isn't built). | 1271 // running mash outside of chrome --mash and chrome isn't built). |
1278 pref_service_ = std::move(pref_service); | 1272 pref_service_ = std::move(pref_service); |
1279 } | 1273 } |
1280 | 1274 |
1281 } // namespace ash | 1275 } // namespace ash |
OLD | NEW |