| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" | 137 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" |
| 138 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 138 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
| 139 #include "ash/touch/touch_transformer_controller.h" | 139 #include "ash/touch/touch_transformer_controller.h" |
| 140 #include "ash/virtual_keyboard_controller.h" | 140 #include "ash/virtual_keyboard_controller.h" |
| 141 #include "base/bind_helpers.h" | 141 #include "base/bind_helpers.h" |
| 142 #include "base/sys_info.h" | 142 #include "base/sys_info.h" |
| 143 #include "chromeos/audio/audio_a11y_controller.h" | 143 #include "chromeos/audio/audio_a11y_controller.h" |
| 144 #include "chromeos/dbus/dbus_thread_manager.h" | 144 #include "chromeos/dbus/dbus_thread_manager.h" |
| 145 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 145 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
| 146 #include "ui/display/chromeos/display_configurator.h" | 146 #include "ui/display/chromeos/display_configurator.h" |
| 147 |
| 148 #if defined(USE_X11) |
| 149 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" |
| 150 #endif |
| 151 |
| 152 #if defined(USE_OZONE) |
| 153 #include "ui/display/types/native_display_delegate.h" |
| 154 #include "ui/ozone/public/ozone_platform.h" |
| 155 #endif |
| 147 #endif // defined(OS_CHROMEOS) | 156 #endif // defined(OS_CHROMEOS) |
| 148 | 157 |
| 149 namespace ash { | 158 namespace ash { |
| 150 | 159 |
| 151 namespace { | 160 namespace { |
| 152 | 161 |
| 153 using aura::Window; | 162 using aura::Window; |
| 154 using views::Widget; | 163 using views::Widget; |
| 155 | 164 |
| 156 // A Corewm VisibilityController subclass that calls the Ash animation routine | 165 // A Corewm VisibilityController subclass that calls the Ash animation routine |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 display_configuration_controller_.reset(new DisplayConfigurationController( | 867 display_configuration_controller_.reset(new DisplayConfigurationController( |
| 859 display_manager_.get(), window_tree_host_manager_.get())); | 868 display_manager_.get(), window_tree_host_manager_.get())); |
| 860 | 869 |
| 861 #if defined(OS_CHROMEOS) | 870 #if defined(OS_CHROMEOS) |
| 862 // When running as part of mash, OzonePlatform is not initialized in the | 871 // When running as part of mash, OzonePlatform is not initialized in the |
| 863 // ash_sysui process. DisplayConfigurator will try to use OzonePlatform and | 872 // ash_sysui process. DisplayConfigurator will try to use OzonePlatform and |
| 864 // crash. Instead, mash can manually set default display size using | 873 // crash. Instead, mash can manually set default display size using |
| 865 // --ash-host-window-bounds flag. | 874 // --ash-host-window-bounds flag. |
| 866 if (in_mus_) | 875 if (in_mus_) |
| 867 display_configurator_->set_configure_display(false); | 876 display_configurator_->set_configure_display(false); |
| 868 display_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); | 877 |
| 878 #if defined(USE_OZONE) |
| 879 display_configurator_->Init( |
| 880 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(), |
| 881 !gpu_support_->IsPanelFittingDisabled()); |
| 882 #elif defined(USE_X11) |
| 883 display_configurator_->Init( |
| 884 base::WrapUnique(new ui::NativeDisplayDelegateX11()), |
| 885 !gpu_support_->IsPanelFittingDisabled()); |
| 886 #endif |
| 869 | 887 |
| 870 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. | 888 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. |
| 871 chromeos::DBusThreadManager* dbus_thread_manager = | 889 chromeos::DBusThreadManager* dbus_thread_manager = |
| 872 chromeos::DBusThreadManager::Get(); | 890 chromeos::DBusThreadManager::Get(); |
| 873 projecting_observer_.reset( | 891 projecting_observer_.reset( |
| 874 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); | 892 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); |
| 875 display_configurator_->AddObserver(projecting_observer_.get()); | 893 display_configurator_->AddObserver(projecting_observer_.get()); |
| 876 AddShellObserver(projecting_observer_.get()); | 894 AddShellObserver(projecting_observer_.get()); |
| 877 | 895 |
| 878 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { | 896 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 | 1222 |
| 1205 void Shell::OnWindowActivated( | 1223 void Shell::OnWindowActivated( |
| 1206 aura::client::ActivationChangeObserver::ActivationReason reason, | 1224 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1207 aura::Window* gained_active, | 1225 aura::Window* gained_active, |
| 1208 aura::Window* lost_active) { | 1226 aura::Window* lost_active) { |
| 1209 if (gained_active) | 1227 if (gained_active) |
| 1210 target_root_window_ = gained_active->GetRootWindow(); | 1228 target_root_window_ = gained_active->GetRootWindow(); |
| 1211 } | 1229 } |
| 1212 | 1230 |
| 1213 } // namespace ash | 1231 } // namespace ash |
| OLD | NEW |