| 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 "chrome/browser/notifications/message_center_notification_manager.h" | 5 #include "chrome/browser/notifications/message_center_notification_manager.h" |
| 6 | 6 |
| 7 #include "chrome/common/pref_names.h" | |
| 8 #include "ui/message_center/message_center_tray.h" | 7 #include "ui/message_center/message_center_tray.h" |
| 9 | 8 |
| 10 void MessageCenterNotificationManager::DisplayFirstRunBalloon() { | 9 void MessageCenterNotificationManager::DisplayFirstRunBalloon() { |
| 11 // Store for posterity the fact that we've shown the first-run balloon. | 10 // Store for posterity the fact that we've shown the first-run balloon. |
| 12 DCHECK(tray_.get()); | 11 DCHECK(tray_.get()); |
| 13 first_run_pref_.SetValue(true); | 12 first_run_pref_.SetValue(true); |
| 14 tray_->DisplayFirstRunBalloon(); | 13 tray_->DisplayFirstRunBalloon(); |
| 15 } | 14 } |
| 16 | 15 |
| 17 void MessageCenterNotificationManager::SetFirstRunTimeoutForTest( | 16 void MessageCenterNotificationManager::SetFirstRunTimeoutForTest( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 44 // No need to restart the timer if it's already going. | 43 // No need to restart the timer if it's already going. |
| 45 if (first_run_balloon_timer_.IsRunning()) | 44 if (first_run_balloon_timer_.IsRunning()) |
| 46 return; | 45 return; |
| 47 | 46 |
| 48 first_run_balloon_timer_.Start( | 47 first_run_balloon_timer_.Start( |
| 49 FROM_HERE, | 48 FROM_HERE, |
| 50 first_run_idle_timeout_, | 49 first_run_idle_timeout_, |
| 51 base::Bind(&MessageCenterNotificationManager::DisplayFirstRunBalloon, | 50 base::Bind(&MessageCenterNotificationManager::DisplayFirstRunBalloon, |
| 52 weak_factory_.GetWeakPtr())); | 51 weak_factory_.GetWeakPtr())); |
| 53 } | 52 } |
| OLD | NEW |