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

Unified Diff: ui/display/chromeos/x11/native_display_delegate_x11.cc

Issue 796263002: Remove synchronous GetDisplays() and Configure() from NativeDisplayDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-refactor5
Patch Set: Removed deprecated calls from TestNativeDisplayDelegate and update the ExternalControl test Created 6 years 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/x11/native_display_delegate_x11.h ('k') | ui/display/types/native_display_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/x11/native_display_delegate_x11.cc
diff --git a/ui/display/chromeos/x11/native_display_delegate_x11.cc b/ui/display/chromeos/x11/native_display_delegate_x11.cc
index fd0402cd4fffcc6c9938292d8e2352850bf1d6c7..a3e9dbd55dc64b7450ae7672f33d4bab6a772c44 100644
--- a/ui/display/chromeos/x11/native_display_delegate_x11.cc
+++ b/ui/display/chromeos/x11/native_display_delegate_x11.cc
@@ -171,7 +171,8 @@ void NativeDisplayDelegateX11::ForceDPMSOn() {
CHECK(DPMSForceLevel(display_, DPMSModeOn));
}
-std::vector<DisplaySnapshot*> NativeDisplayDelegateX11::GetDisplays() {
+void NativeDisplayDelegateX11::GetDisplays(
+ const GetDisplaysCallback& callback) {
CHECK(screen_) << "Server not grabbed";
cached_outputs_.clear();
@@ -189,12 +190,7 @@ std::vector<DisplaySnapshot*> NativeDisplayDelegateX11::GetDisplays() {
XRRFreeOutputInfo(output_info);
}
- return cached_outputs_.get();
-}
-
-void NativeDisplayDelegateX11::GetDisplays(
- const GetDisplaysCallback& callback) {
- callback.Run(GetDisplays());
+ callback.Run(cached_outputs_.get());
}
void NativeDisplayDelegateX11::AddMode(const DisplaySnapshot& output,
@@ -211,24 +207,18 @@ void NativeDisplayDelegateX11::AddMode(const DisplaySnapshot& output,
XRRAddOutputMode(display_, x11_output.output(), mode_id);
}
-bool NativeDisplayDelegateX11::Configure(const DisplaySnapshot& output,
+void NativeDisplayDelegateX11::Configure(const DisplaySnapshot& output,
const DisplayMode* mode,
- const gfx::Point& origin) {
+ const gfx::Point& origin,
+ const ConfigureCallback& callback) {
const DisplaySnapshotX11& x11_output =
static_cast<const DisplaySnapshotX11&>(output);
RRMode mode_id = None;
if (mode)
mode_id = static_cast<const DisplayModeX11*>(mode)->mode_id();
- return ConfigureCrtc(
- x11_output.crtc(), mode_id, x11_output.output(), origin.x(), origin.y());
-}
-
-void NativeDisplayDelegateX11::Configure(const DisplaySnapshot& output,
- const DisplayMode* mode,
- const gfx::Point& origin,
- const ConfigureCallback& callback) {
- callback.Run(Configure(output, mode, origin));
+ callback.Run(ConfigureCrtc(x11_output.crtc(), mode_id, x11_output.output(),
+ origin.x(), origin.y()));
}
bool NativeDisplayDelegateX11::ConfigureCrtc(RRCrtc crtc,
« no previous file with comments | « ui/display/chromeos/x11/native_display_delegate_x11.h ('k') | ui/display/types/native_display_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698