| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/display/resolution_notification_controller.h" | 5 #include "ash/display/resolution_notification_controller.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
| 8 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| 9 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 10 #include "ash/system/system_notifier.h" | 12 #include "ash/system/system_notifier.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 12 #include "grit/ash_resources.h" | 14 #include "grit/ash_resources.h" |
| 13 #include "grit/ash_strings.h" | 15 #include "grit/ash_strings.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 15 #include "ui/base/l10n/time_format.h" | 17 #include "ui/base/l10n/time_format.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 scoped_ptr<Notification> notification(new Notification( | 230 scoped_ptr<Notification> notification(new Notification( |
| 229 message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, message, | 231 message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, message, |
| 230 timeout_message, bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), | 232 timeout_message, bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), |
| 231 base::string16() /* display_source */, GURL(), | 233 base::string16() /* display_source */, GURL(), |
| 232 message_center::NotifierId( | 234 message_center::NotifierId( |
| 233 message_center::NotifierId::SYSTEM_COMPONENT, | 235 message_center::NotifierId::SYSTEM_COMPONENT, |
| 234 system_notifier::kNotifierDisplayResolutionChange), | 236 system_notifier::kNotifierDisplayResolutionChange), |
| 235 data, new ResolutionChangeNotificationDelegate( | 237 data, new ResolutionChangeNotificationDelegate( |
| 236 this, change_info_->timeout_count > 0))); | 238 this, change_info_->timeout_count > 0))); |
| 237 notification->SetSystemPriority(); | 239 notification->SetSystemPriority(); |
| 238 message_center->AddNotification(notification.Pass()); | 240 message_center->AddNotification(std::move(notification)); |
| 239 } | 241 } |
| 240 | 242 |
| 241 void ResolutionNotificationController::OnTimerTick() { | 243 void ResolutionNotificationController::OnTimerTick() { |
| 242 if (!change_info_) | 244 if (!change_info_) |
| 243 return; | 245 return; |
| 244 | 246 |
| 245 --change_info_->timeout_count; | 247 --change_info_->timeout_count; |
| 246 if (change_info_->timeout_count == 0) | 248 if (change_info_->timeout_count == 0) |
| 247 RevertResolutionChange(); | 249 RevertResolutionChange(); |
| 248 else | 250 else |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 this, | 303 this, |
| 302 &ResolutionNotificationController::OnTimerTick); | 304 &ResolutionNotificationController::OnTimerTick); |
| 303 } | 305 } |
| 304 } | 306 } |
| 305 | 307 |
| 306 void ResolutionNotificationController::SuppressTimerForTest() { | 308 void ResolutionNotificationController::SuppressTimerForTest() { |
| 307 g_use_timer = false; | 309 g_use_timer = false; |
| 308 } | 310 } |
| 309 | 311 |
| 310 } // namespace ash | 312 } // namespace ash |
| OLD | NEW |