Index: chrome/browser/upgrade_detector_impl.h |
diff --git a/chrome/browser/upgrade_detector_impl.h b/chrome/browser/upgrade_detector_impl.h |
index 435d294b662f214c6a3edca76eb124527b723ba8..fe50aa6c0281a979c7cb5f35efa28a214166df27 100644 |
--- a/chrome/browser/upgrade_detector_impl.h |
+++ b/chrome/browser/upgrade_detector_impl.h |
@@ -6,12 +6,15 @@ |
#define CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ |
#include "base/memory/weak_ptr.h" |
+#include "base/time.h" |
#include "base/timer.h" |
#include "chrome/browser/upgrade_detector.h" |
+#include "net/url_request/url_fetcher_delegate.h" |
template <typename T> struct DefaultSingletonTraits; |
-class UpgradeDetectorImpl : public UpgradeDetector { |
+class UpgradeDetectorImpl : public UpgradeDetector, |
+ public net::URLFetcherDelegate { |
public: |
virtual ~UpgradeDetectorImpl(); |
@@ -30,11 +33,21 @@ class UpgradeDetectorImpl : public UpgradeDetector { |
// notifying the user. |
void UpgradeDetected(); |
+ // Sends a URL request to get a sane time to be compared to the build time. |
+ void CompareBuildTimeToSaneTime(); |
+ |
// 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(); |
+ // net::URLFetcherDelegate implementation: |
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
+ |
+ // Contains the current time request. Will only have a value while a request |
+ // is pending, and will be reset by |OnURLFetchComplete|. |
+ scoped_ptr<net::URLFetcher> pending_time_request_; |
+ |
// We periodically check to see if Chrome has been upgraded. |
base::RepeatingTimer<UpgradeDetectorImpl> detect_upgrade_timer_; |
@@ -50,6 +63,9 @@ class UpgradeDetectorImpl : public UpgradeDetector { |
// True if this build is a dev or canary channel build. |
bool is_unstable_channel_; |
+ // The date the binaries were built. |
+ base::Time build_date_; |
+ |
DISALLOW_COPY_AND_ASSIGN(UpgradeDetectorImpl); |
}; |