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