summaryrefslogtreecommitdiffstats
path: root/chrome/browser/upgrade_detector.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 00:17:22 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 00:17:22 +0000
commit8fcec3c79f1c8f2edae6a1b064cf60c39720ba54 (patch)
treed2949c5b8fc3a926940366ca3a7fe4eaacdc36e7 /chrome/browser/upgrade_detector.h
parent8622c0c034073504735808dc83dd509ce444b4ae (diff)
downloadchromium_src-8fcec3c79f1c8f2edae6a1b064cf60c39720ba54.zip
chromium_src-8fcec3c79f1c8f2edae6a1b064cf60c39720ba54.tar.gz
chromium_src-8fcec3c79f1c8f2edae6a1b064cf60c39720ba54.tar.bz2
Linux/GTK: implement update notification.
BUG=45148 TEST=compile chrome with PRODUCT_VERSION manually set to something higher than the current version (e.g. 7.0.0.0), and manually set the upgrade detector time to something short (like 10 seconds). Launch chrome and wait a short time for the update notification to appear. The update notification should pulse every few seconds, and should stop pulsing when the user opens the wrench menu. The about menu item should launch a dialog that allows the user to restart chrome, restoring the current session. Review URL: http://codereview.chromium.org/2365003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/upgrade_detector.h')
-rw-r--r--chrome/browser/upgrade_detector.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/upgrade_detector.h b/chrome/browser/upgrade_detector.h
index 9a7da11..036d43c 100644
--- a/chrome/browser/upgrade_detector.h
+++ b/chrome/browser/upgrade_detector.h
@@ -8,6 +8,8 @@
#include "base/singleton.h"
#include "base/timer.h"
+class PrefService;
+
///////////////////////////////////////////////////////////////////////////////
// UpgradeDetector
//
@@ -22,17 +24,21 @@ class UpgradeDetector {
public:
~UpgradeDetector();
+ static void RegisterPrefs(PrefService* prefs);
+
bool notify_upgrade() { return notify_upgrade_; }
private:
UpgradeDetector();
friend struct DefaultSingletonTraits<UpgradeDetector>;
- // Checks with Omaha if we have the latest version. If not, sends out a
- // notification and starts a one shot timer to wait until notifying the
- // user.
+ // 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();
+
// 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.
@@ -44,8 +50,10 @@ class UpgradeDetector {
// After we detect an upgrade we wait a set time before notifying the user.
base::OneShotTimer<UpgradeDetector> upgrade_notification_timer_;
- // Whether we have detected an upgrade happening while we were running.
- bool upgrade_detected_;
+ // 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_;
// Whether we have waited long enough after detecting an upgrade (to see
// is we should start nagging about upgrading).