| 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 297d54326916649163d325b92753837f5ffa1899..4b9a7a3b17d5721bf6e17ad9ab25320859c37341 100644
|
| --- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
|
| @@ -491,19 +491,28 @@ void DisplayOptionsHandler::HandleSetDisplayMode(const base::ListValue* args) {
|
| display::DisplayManager* display_manager = GetDisplayManager();
|
| scoped_refptr<display::ManagedDisplayMode> current_mode =
|
| display_manager->GetActiveModeForDisplayId(display_id);
|
| +
|
| + if (mode->IsEquivalent(current_mode)) {
|
| + LOG(ERROR) << "New display mode matches current mode.";
|
| + return;
|
| + }
|
| +
|
| + // We must prepare the notification before we set the mode, since setting
|
| + // the mode actually shows the notification, so it should be ready by then.
|
| + // crbug.com/701389.
|
| + if (display::Display::IsInternalDisplayId(display_id)) {
|
| + // For external displays, show a notification confirming the resolution
|
| + // change.
|
| + ash::Shell::GetInstance()
|
| + ->resolution_notification_controller()
|
| + ->PrepareNotification(display_id, current_mode, mode,
|
| + base::Bind(&chromeos::StoreDisplayPrefs));
|
| + }
|
| +
|
| if (!display_manager->SetDisplayMode(display_id, mode)) {
|
| 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::GetInstance()
|
| - ->resolution_notification_controller()
|
| - ->PrepareNotification(display_id, current_mode, mode,
|
| - base::Bind(&chromeos::StoreDisplayPrefs));
|
| }
|
|
|
| void DisplayOptionsHandler::HandleSetRotation(const base::ListValue* args) {
|
|
|