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

Unified Diff: chrome/browser/ui/webui/options/chromeos/display_options_handler.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
« no previous file with comments | « chrome/browser/extensions/display_info_provider_chromeos.cc ('k') | ui/display/manager/display_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
index 4ea500a53eead1f346aacc8c8c58ca38cf170927..fc794b7949d0797ddc3229da10ca05062c1b24a9 100644
--- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
@@ -491,17 +491,20 @@ void DisplayOptionsHandler::HandleSetDisplayMode(const base::ListValue* args) {
display::DisplayManager* display_manager = GetDisplayManager();
scoped_refptr<display::ManagedDisplayMode> current_mode =
display_manager->GetActiveModeForDisplayId(display_id);
- if (!display_manager->SetDisplayMode(display_id, mode)) {
+
+ if (mode->IsEquivalent(current_mode)) {
+ LOG(ERROR) << "New display mode matches current mode.";
+ return;
+ }
+
+ if (!ash::Shell::Get()
+ ->resolution_notification_controller()
+ ->PrepareNotificationAndSetDisplayMode(
+ display_id, current_mode, mode,
+ base::Bind(&chromeos::StoreDisplayPrefs))) {
LOG(ERROR) << "Unable to set display mode for: " << display_id
<< " Mode: " << *mode_data;
- return;
}
- if (display::Display::IsInternalDisplayId(display_id))
- return;
- // For external displays, show a notification confirming the resolution
- // change.
- ash::Shell::Get()->resolution_notification_controller()->PrepareNotification(
- display_id, current_mode, mode, base::Bind(&chromeos::StoreDisplayPrefs));
}
void DisplayOptionsHandler::HandleSetRotation(const base::ListValue* args) {
« no previous file with comments | « chrome/browser/extensions/display_info_provider_chromeos.cc ('k') | ui/display/manager/display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698