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

Unified Diff: services/ui/display/platform_screen_impl_ozone.cc

Issue 2274353003: Add PlatformScreenDelegate and start implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes for comments. Created 4 years, 4 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 | « services/ui/display/platform_screen_impl_ozone.h ('k') | services/ui/service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/display/platform_screen_impl_ozone.cc
diff --git a/services/ui/display/platform_screen_impl_ozone.cc b/services/ui/display/platform_screen_impl_ozone.cc
index c4f1ada7c42de733cdd48d54424f1dc7f48f1bc0..71ba37b39b86d50e7cbced4990065ad9e3573e77 100644
--- a/services/ui/display/platform_screen_impl_ozone.cc
+++ b/services/ui/display/platform_screen_impl_ozone.cc
@@ -36,18 +36,16 @@ PlatformScreenImplOzone::~PlatformScreenImplOzone() {
display_configurator_.RemoveObserver(this);
}
-void PlatformScreenImplOzone::Init() {
+void PlatformScreenImplOzone::Init(PlatformScreenDelegate* delegate) {
+ DCHECK(delegate);
+ delegate_ = delegate;
+
// We want display configuration to happen even off device to keep the control
// flow similar.
display_configurator_.set_configure_display(true);
display_configurator_.AddObserver(this);
display_configurator_.Init(
ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(), false);
-}
-
-void PlatformScreenImplOzone::ConfigurePhysicalDisplay(
- const PlatformScreen::ConfiguredDisplayCallback& callback) {
- callback_ = callback;
if (base::SysInfo::IsRunningOnChromeOS()) {
display_configurator_.ForceInitialConfigure(kChromeOsBootColor);
@@ -96,7 +94,7 @@ void PlatformScreenImplOzone::OnDisplayModeChanged(
// Keep track of what displays have already been added.
displays_.insert(display->display_id());
- callback_.Run(id, bounds);
+ delegate_->OnDisplayAdded(this, id, bounds);
}
DCHECK(displays_ == all_displays) << "Removing displays is not supported.";
« no previous file with comments | « services/ui/display/platform_screen_impl_ozone.h ('k') | services/ui/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698