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

Unified Diff: ui/display/chromeos/display_configurator.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: fix unique_ptr 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/chromeos/display_configurator.h ('k') | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/display_configurator.cc
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc
index 633f813ebca34914d485550cfa2f580500736fc3..e1def2037131a0edf7611ec5def3d6eca7f2aba3 100644
--- a/ui/display/chromeos/display_configurator.cc
+++ b/ui/display/chromeos/display_configurator.cc
@@ -520,7 +520,9 @@ void DisplayConfigurator::SetInitialDisplayPower(
NotifyPowerStateObservers();
}
-void DisplayConfigurator::Init(bool is_panel_fitting_enabled) {
+void DisplayConfigurator::Init(
+ std::unique_ptr<NativeDisplayDelegate> display_delegate,
+ bool is_panel_fitting_enabled) {
is_panel_fitting_enabled_ = is_panel_fitting_enabled;
if (!configure_display_ || display_externally_controlled_)
return;
@@ -528,7 +530,7 @@ void DisplayConfigurator::Init(bool is_panel_fitting_enabled) {
// If the delegate is already initialized don't update it (For example, tests
// set their own delegates).
if (!native_display_delegate_) {
- native_display_delegate_ = CreatePlatformNativeDisplayDelegate();
+ native_display_delegate_ = std::move(display_delegate);
native_display_delegate_->AddObserver(this);
}
}
@@ -608,6 +610,7 @@ void DisplayConfigurator::ForceInitialConfigure(
if (!configure_display_ || display_externally_controlled_)
return;
+ DCHECK(native_display_delegate_);
native_display_delegate_->Initialize();
// ForceInitialConfigure should be the first configuration so there shouldn't
« no previous file with comments | « ui/display/chromeos/display_configurator.h ('k') | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698