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

Unified Diff: components/mus/ws/platform_screen_impl_ozone.cc

Issue 2081253002: Implement rudimentary touchscreen support in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing pure virtual. Created 4 years, 6 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 | « components/mus/ws/platform_screen_impl_ozone.h ('k') | components/mus/ws/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/platform_screen_impl_ozone.cc
diff --git a/components/mus/ws/platform_screen_impl_ozone.cc b/components/mus/ws/platform_screen_impl_ozone.cc
index f6d872790440e2177f70ed76e3460ad8f3de07f6..91f2ba249dae47d1f382b706b1b95322b188fa51 100644
--- a/components/mus/ws/platform_screen_impl_ozone.cc
+++ b/components/mus/ws/platform_screen_impl_ozone.cc
@@ -30,18 +30,11 @@ void FixedSizeScreenConfiguration(
callback.Run(1, gfx::Rect(1024, 768));
}
-// The display subsystem calls |OnDisplayConfigured| for each display that has
-// been successfully configured. This in turn calls |callback_| with the
-// identity and bounds of each physical display.
-void OnDisplayConfigured(
- const PlatformScreen::ConfiguredDisplayCallback& callback,
- int64_t id,
- const gfx::Rect& bounds,
- bool success) {
- if (success)
- callback.Run(id, bounds);
- else
- LOG(FATAL) << "Failed to configure display at " << bounds.ToString();
+void GetDisplaysFinished(const std::vector<ui::DisplaySnapshot*>& displays) {
+ // We don't really care about list of displays, we just want the snapshots
+ // held by DrmDisplayManager to be updated. This only only happens when we
+ // call NativeDisplayDelegate::GetDisplays(). Although, this would be a good
+ // place to have PlatformScreen cache the snapshots if need be.
}
} // namespace
@@ -77,11 +70,12 @@ void PlatformScreenImplOzone::ConfigurePhysicalDisplay(
base::Bind(&PlatformScreenImplOzone::OnDisplaysAquired,
weak_ptr_factory_.GetWeakPtr(), callback));
- } else
-#endif // defined(OS_CHROMEOS)
- // PostTask()ed to maximize control flow similarity with the ChromeOS case.
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&FixedSizeScreenConfiguration, callback));
+ return;
+ }
+#endif // defined(OS_CHROMEOS)
+ // PostTask()ed to maximize control flow similarity with the ChromeOS case.
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FixedSizeScreenConfiguration, callback));
}
void PlatformScreenImplOzone::OnConfigurationChanged() {}
@@ -107,11 +101,26 @@ void PlatformScreenImplOzone::OnDisplaysAquired(
// Configure.
native_display_delegate_->Configure(
*display, display->native_mode(), origin,
- base::Bind(&OnDisplayConfigured, callback, display->display_id(),
+ base::Bind(&PlatformScreenImplOzone::OnDisplayConfigured,
+ weak_ptr_factory_.GetWeakPtr(), callback,
+ display->display_id(),
gfx::Rect(origin, display->native_mode()->size())));
origin.Offset(display->native_mode()->size().width(), 0);
}
}
+void PlatformScreenImplOzone::OnDisplayConfigured(
+ const ConfiguredDisplayCallback& callback,
+ int64_t id,
+ const gfx::Rect& bounds,
+ bool success) {
+ if (success) {
+ native_display_delegate_->GetDisplays(base::Bind(&GetDisplaysFinished));
+ callback.Run(id, bounds);
+ } else {
+ LOG(FATAL) << "Failed to configure display at " << bounds.ToString();
+ }
+}
+
} // namespace ws
} // namespace mus
« no previous file with comments | « components/mus/ws/platform_screen_impl_ozone.h ('k') | components/mus/ws/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698