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 "ash/display/display_info.h" | 7 #include "ash/display/display_info.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/system_notifier.h" | 10 #include "ash/system/system_notifier.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 display_name, | 218 display_name, |
219 base::UTF8ToUTF16(change_info_->new_resolution.size.ToString())) : | 219 base::UTF8ToUTF16(change_info_->new_resolution.size.ToString())) : |
220 l10n_util::GetStringFUTF16( | 220 l10n_util::GetStringFUTF16( |
221 IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED_TO_UNSUPPORTED, | 221 IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED_TO_UNSUPPORTED, |
222 display_name, | 222 display_name, |
223 base::UTF8ToUTF16(change_info_->new_resolution.size.ToString()), | 223 base::UTF8ToUTF16(change_info_->new_resolution.size.ToString()), |
224 base::UTF8ToUTF16(change_info_->current_resolution.size.ToString())); | 224 base::UTF8ToUTF16(change_info_->current_resolution.size.ToString())); |
225 | 225 |
226 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 226 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
227 scoped_ptr<Notification> notification(new Notification( | 227 scoped_ptr<Notification> notification(new Notification( |
228 message_center::NOTIFICATION_TYPE_SIMPLE, | 228 message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, message, |
229 kNotificationId, | 229 timeout_message, bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), |
230 message, | 230 base::string16() /* display_source */, GURL(), |
231 timeout_message, | |
232 bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), | |
233 base::string16() /* display_source */, | |
234 message_center::NotifierId( | 231 message_center::NotifierId( |
235 message_center::NotifierId::SYSTEM_COMPONENT, | 232 message_center::NotifierId::SYSTEM_COMPONENT, |
236 system_notifier::kNotifierDisplayResolutionChange), | 233 system_notifier::kNotifierDisplayResolutionChange), |
237 data, | 234 data, new ResolutionChangeNotificationDelegate( |
238 new ResolutionChangeNotificationDelegate( | 235 this, change_info_->timeout_count > 0))); |
239 this, change_info_->timeout_count > 0))); | |
240 notification->SetSystemPriority(); | 236 notification->SetSystemPriority(); |
241 message_center->AddNotification(notification.Pass()); | 237 message_center->AddNotification(notification.Pass()); |
242 } | 238 } |
243 | 239 |
244 void ResolutionNotificationController::OnTimerTick() { | 240 void ResolutionNotificationController::OnTimerTick() { |
245 if (!change_info_) | 241 if (!change_info_) |
246 return; | 242 return; |
247 | 243 |
248 --change_info_->timeout_count; | 244 --change_info_->timeout_count; |
249 if (change_info_->timeout_count == 0) | 245 if (change_info_->timeout_count == 0) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 this, | 300 this, |
305 &ResolutionNotificationController::OnTimerTick); | 301 &ResolutionNotificationController::OnTimerTick); |
306 } | 302 } |
307 } | 303 } |
308 | 304 |
309 void ResolutionNotificationController::SuppressTimerForTest() { | 305 void ResolutionNotificationController::SuppressTimerForTest() { |
310 g_use_timer = false; | 306 g_use_timer = false; |
311 } | 307 } |
312 | 308 |
313 } // namespace ash | 309 } // namespace ash |
OLD | NEW |