| Index: chrome/browser/upgrade_detector.h
|
| ===================================================================
|
| --- chrome/browser/upgrade_detector.h (revision 88800)
|
| +++ chrome/browser/upgrade_detector.h (working copy)
|
| @@ -9,7 +9,6 @@
|
| #include "base/timer.h"
|
| #include "ui/gfx/image.h"
|
|
|
| -template <typename T> struct DefaultSingletonTraits;
|
| class PrefService;
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| @@ -39,10 +38,10 @@
|
| 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 @@
|
| // 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 UPGRADE_DETECTED notification and record upgrade_detected_time_.
|
| + void NotifyUpgradeDetected();
|
|
|
| - // Sends out a notification and starts a one shot timer to wait until
|
| - // notifying the user.
|
| - void UpgradeDetected();
|
| + // Sends out UPGRADE_RECOMMENDED notification and set notify_upgrade_.
|
| + void NotifyUpgradeRecommended();
|
|
|
| - // 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();
|
| + // Accessors.
|
| + const base::Time& upgrade_detected_time() const {
|
| + return upgrade_detected_time_;
|
| + }
|
|
|
| - // We periodically check to see if Chrome has been upgraded.
|
| - base::RepeatingTimer<UpgradeDetector> detect_upgrade_timer_;
|
| + void set_upgrade_notification_stage(UpgradeNotificationAnnoyanceLevel stage) {
|
| + upgrade_notification_stage_ = stage;
|
| + }
|
|
|
| - // 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_;
|
| -
|
| + 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_;
|
|
|
|
|