Chromium Code Reviews| Index: chrome/browser/upgrade_detector.h |
| diff --git a/chrome/browser/upgrade_detector.h b/chrome/browser/upgrade_detector.h |
| index 00227d5d7aee8732300895ce754b57af32e004a3..bc043e156c614d4977ed9b320fd45a76e92e7a6b 100644 |
| --- a/chrome/browser/upgrade_detector.h |
| +++ b/chrome/browser/upgrade_detector.h |
| @@ -9,7 +9,6 @@ |
| #include "base/timer.h" |
| #include "ui/gfx/image.h" |
| -template <typename T> struct DefaultSingletonTraits; |
| class PrefService; |
| /////////////////////////////////////////////////////////////////////////////// |
| @@ -39,10 +38,10 @@ class UpgradeDetector { |
| UPGRADE_ICON_TYPE_MENU_ICON, // For showing in the wrench menu. |
| }; |
| - // Returns the singleton instance. |
| + // Returns the singleton implementation instance. |
| static UpgradeDetector* GetInstance(); |
| - ~UpgradeDetector(); |
| + virtual ~UpgradeDetector(); |
| static void RegisterPrefs(PrefService* prefs); |
| @@ -55,41 +54,28 @@ class UpgradeDetector { |
| // within the wrench menu. |
| int GetIconResourceID(UpgradeNotificationIconType type); |
| - private: |
| - friend struct DefaultSingletonTraits<UpgradeDetector>; |
| - |
| + protected: |
| UpgradeDetector(); |
| - // Launches a task on the file thread to check if we have the latest version. |
| - void CheckForUpgrade(); |
| - |
| - // Sends out a notification and starts a one shot timer to wait until |
| - // notifying the user. |
| - void UpgradeDetected(); |
| + // Sends out UPGRADE_DETECTED notification and record upgrade_detected_time_. |
| + void NotifyUpgradeDetected(); |
| - // The function that sends out a notification (after a certain time has |
| - // elapsed) that lets the rest of the UI know we should start notifying the |
| - // user that a new version is available. |
| - void NotifyOnUpgrade(); |
| + // Sends out UPGRADE_RECOMMENDED notification and set notify_upgrade_. |
| + void NotifyUpgradeRecommended(); |
| - // We periodically check to see if Chrome has been upgraded. |
| - base::RepeatingTimer<UpgradeDetector> detect_upgrade_timer_; |
| + // accessors |
|
Finnur
2011/06/12 12:07:43
nit: Capital A and end with period.
xiyuan
2011/06/12 21:02:07
Done.
|
| + const base::Time& upgrade_detected_time() const { |
| + return upgrade_detected_time_; |
| + } |
| - // After we detect an upgrade we start a recurring timer to see if enough time |
| - // has passed and we should start notifying the user. |
| - base::RepeatingTimer<UpgradeDetector> upgrade_notification_timer_; |
| - |
| - // We use this factory to create callback tasks for UpgradeDetected. We pass |
| - // the task to the actual upgrade detection code, which is in |
| - // DetectUpgradeTask. |
| - ScopedRunnableMethodFactory<UpgradeDetector> method_factory_; |
| + void set_upgrade_notification_stage(UpgradeNotificationAnnoyanceLevel stage) { |
| + upgrade_notification_stage_ = stage; |
| + } |
| + private: |
| // When the upgrade was detected. |
| base::Time upgrade_detected_time_; |
| - // True if this build is a dev or canary channel build. |
| - bool is_unstable_channel_; |
| - |
| // The stage at which the annoyance level for upgrade notifications is at. |
| UpgradeNotificationAnnoyanceLevel upgrade_notification_stage_; |