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

Unified Diff: ash/shell.cc

Issue 2523873002: Remove DisplayChangeObserver ash dependencies. (Closed)
Patch Set: Remove comment. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index a539468c0ab2943eb1531efa247ec3966d96e870..7cdbaa461be906261338f70987460d4198498f0c 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -118,12 +118,14 @@
#include "ash/common/ash_constants.h"
#include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller.h"
#include "ash/common/system/chromeos/power/power_status.h"
+#include "ash/display/ash_display_string_provider.h"
#include "ash/display/display_change_observer_chromeos.h"
#include "ash/display/display_color_manager_chromeos.h"
#include "ash/display/display_error_observer_chromeos.h"
#include "ash/display/projecting_observer_chromeos.h"
#include "ash/display/resolution_notification_controller.h"
#include "ash/display/screen_orientation_controller_chromeos.h"
+#include "ash/display/shutdown_observer_chromeos.h"
#include "ash/sticky_keys/sticky_keys_controller.h"
#include "ash/system/chromeos/power/power_event_observer.h"
#include "ash/system/chromeos/power/video_activity_notifier.h"
@@ -560,6 +562,7 @@ Shell::~Shell() {
wm_shell_->RemoveShellObserver(projecting_observer_.get());
}
display_change_observer_.reset();
+ shutdown_observer_.reset();
PowerStatus::Shutdown();
@@ -622,7 +625,15 @@ void Shell::Init(const ShellInitParams& init_params) {
wm_shell_->AddShellObserver(projecting_observer_.get());
if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) {
- display_change_observer_.reset(new DisplayChangeObserver);
+ display_change_observer_ = base::MakeUnique<DisplayChangeObserver>(
+ base::MakeUnique<AshDisplayStringProvider>());
+ display_change_observer_->set_display_configurator(
+ display_configurator_.get());
+ display_change_observer_->set_display_manager(display_manager_.get());
+
+ shutdown_observer_ =
+ base::MakeUnique<ShutdownObserver>(display_configurator_.get());
+
// Register |display_change_observer_| first so that the rest of
// observer gets invoked after the root windows are configured.
display_configurator_->AddObserver(display_change_observer_.get());

Powered by Google App Engine
This is Rietveld 408576698