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

Unified Diff: chrome/browser/extensions/display_info_provider_chromeos.cc

Issue 2799963003: Fix errors in display resolution change notifications (Closed)
Patch Set: Update commit message Created 3 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
Index: chrome/browser/extensions/display_info_provider_chromeos.cc
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc
index d981386da44304c48d8c8fffb92970c2f2dbd189..a7dc13e29d093f2fb7a283e22162fe0e78aee8db 100644
--- a/chrome/browser/extensions/display_info_provider_chromeos.cc
+++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -352,19 +352,19 @@ bool ValidateParamsForDisplay(const system_display::DisplayProperties& info,
return false;
}
- if (!display_manager->SetDisplayMode(id, new_mode)) {
+ // If it's the internal display, the display mode will be applied directly,
+ // otherwise a confirm/revert notification will be prepared first, and the
+ // display mode will be applied. If the user accepts the mode change by
+ // dismissing the notification, StoreDisplayPrefs() will be called back to
+ // persist the new preferences.
+ if (!ash::Shell::Get()
+ ->resolution_notification_controller()
+ ->PrepareNotificationAndSetDisplayMode(
+ id, current_mode, new_mode,
+ base::Bind(&chromeos::StoreDisplayPrefs))) {
*error = "Unable to set the display mode.";
return false;
}
-
- if (!display::Display::IsInternalDisplayId(id)) {
- // For external displays, show a notification confirming the resolution
- // change.
- ash::Shell::Get()
- ->resolution_notification_controller()
- ->PrepareNotification(id, current_mode, new_mode,
- base::Bind(&chromeos::StoreDisplayPrefs));
- }
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698