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

Side by Side Diff: ash/shell.cc

Issue 1878903002: Use injection and remove ozone dependency from ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | content/common/gpu/media/rendering_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 #include "ash/system/chromeos/power/video_activity_notifier.h" 136 #include "ash/system/chromeos/power/video_activity_notifier.h"
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/dbus/dbus_thread_manager.h" 143 #include "chromeos/dbus/dbus_thread_manager.h"
144 #include "ui/chromeos/user_activity_power_manager_notifier.h" 144 #include "ui/chromeos/user_activity_power_manager_notifier.h"
145 #include "ui/display/chromeos/display_configurator.h" 145 #include "ui/display/chromeos/display_configurator.h"
146
147 #if defined(USE_X11)
148 #include "ui/display/chromeos/x11/native_display_delegate_x11.h"
149 #endif
150
151 #if defined(USE_OZONE)
152 #include "ui/display/types/native_display_delegate.h"
153 #include "ui/ozone/public/ozone_platform.h"
154 #endif
146 #endif // defined(OS_CHROMEOS) 155 #endif // defined(OS_CHROMEOS)
147 156
148 namespace ash { 157 namespace ash {
149 158
150 namespace { 159 namespace {
151 160
152 using aura::Window; 161 using aura::Window;
153 using views::Widget; 162 using views::Widget;
154 163
155 // A Corewm VisibilityController subclass that calls the Ash animation routine 164 // A Corewm VisibilityController subclass that calls the Ash animation routine
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 display_configuration_controller_.reset(new DisplayConfigurationController( 862 display_configuration_controller_.reset(new DisplayConfigurationController(
854 display_manager_.get(), window_tree_host_manager_.get())); 863 display_manager_.get(), window_tree_host_manager_.get()));
855 864
856 #if defined(OS_CHROMEOS) 865 #if defined(OS_CHROMEOS)
857 // When running as part of mash, OzonePlatform is not initialized in the 866 // When running as part of mash, OzonePlatform is not initialized in the
858 // ash_sysui process. DisplayConfigurator will try to use OzonePlatform and 867 // ash_sysui process. DisplayConfigurator will try to use OzonePlatform and
859 // crash. Instead, mash can manually set default display size using 868 // crash. Instead, mash can manually set default display size using
860 // --ash-host-window-bounds flag. 869 // --ash-host-window-bounds flag.
861 if (in_mus_) 870 if (in_mus_)
862 display_configurator_->set_configure_display(false); 871 display_configurator_->set_configure_display(false);
863 display_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); 872
873 #if defined(USE_OZONE)
874 display_configurator_->Init(
875 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(),
876 !gpu_support_->IsPanelFittingDisabled());
877 #elif defined(USE_X11)
878 display_configurator_->Init(
879 make_scoped_ptr(new ui::NativeDisplayDelegateX11()),
880 !gpu_support_->IsPanelFittingDisabled());
oshima 2016/04/12 16:59:41 I'm assuming that NativeDisplayDelegateX11 will be
881 #endif
864 882
865 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. 883 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell.
866 chromeos::DBusThreadManager* dbus_thread_manager = 884 chromeos::DBusThreadManager* dbus_thread_manager =
867 chromeos::DBusThreadManager::Get(); 885 chromeos::DBusThreadManager::Get();
868 projecting_observer_.reset( 886 projecting_observer_.reset(
869 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); 887 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient()));
870 display_configurator_->AddObserver(projecting_observer_.get()); 888 display_configurator_->AddObserver(projecting_observer_.get());
871 AddShellObserver(projecting_observer_.get()); 889 AddShellObserver(projecting_observer_.get());
872 890
873 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { 891 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 1213
1196 void Shell::OnWindowActivated( 1214 void Shell::OnWindowActivated(
1197 aura::client::ActivationChangeObserver::ActivationReason reason, 1215 aura::client::ActivationChangeObserver::ActivationReason reason,
1198 aura::Window* gained_active, 1216 aura::Window* gained_active,
1199 aura::Window* lost_active) { 1217 aura::Window* lost_active) {
1200 if (gained_active) 1218 if (gained_active)
1201 target_root_window_ = gained_active->GetRootWindow(); 1219 target_root_window_ = gained_active->GetRootWindow();
1202 } 1220 }
1203 1221
1204 } // namespace ash 1222 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/rendering_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698