Index: ash/display/resolution_notification_controller.cc |
diff --git a/ash/display/resolution_notification_controller.cc b/ash/display/resolution_notification_controller.cc |
index a765d610fec89b826d06f220c872d7decebfa538..e2755a037a88ce65a3b746f816566c5b53db0e63 100644 |
--- a/ash/display/resolution_notification_controller.cc |
+++ b/ash/display/resolution_notification_controller.cc |
@@ -71,11 +71,11 @@ void ResolutionChangeNotificationDelegate::Error() { |
void ResolutionChangeNotificationDelegate::Close(bool by_user) { |
if (by_user) |
- controller_->AcceptResolutionChange(); |
+ controller_->AcceptResolutionChange(false); |
} |
void ResolutionChangeNotificationDelegate::Click() { |
- controller_->AcceptResolutionChange(); |
+ controller_->AcceptResolutionChange(true); |
} |
bool ResolutionChangeNotificationDelegate::HasClickedListener() { |
@@ -86,7 +86,7 @@ void ResolutionChangeNotificationDelegate::ButtonClick(int button_index) { |
// If there's the timeout, the first button is "Accept". Otherwise the |
// button click should be "Revert". |
if (has_timeout_ && button_index == 0) |
- controller_->AcceptResolutionChange(); |
+ controller_->AcceptResolutionChange(true); |
else |
controller_->RevertResolutionChange(); |
} |
@@ -243,9 +243,12 @@ void ResolutionNotificationController::OnTimerTick() { |
CreateOrUpdateNotification(); |
} |
-void ResolutionNotificationController::AcceptResolutionChange() { |
- message_center::MessageCenter::Get()->RemoveNotification( |
- kNotificationId, false /* by_user */); |
+void ResolutionNotificationController::AcceptResolutionChange( |
+ bool close_notification) { |
+ if (close_notification) { |
+ message_center::MessageCenter::Get()->RemoveNotification( |
+ kNotificationId, false /* by_user */); |
+ } |
base::Closure callback = change_info_->accept_callback; |
change_info_.reset(); |
callback.Run(); |