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..f7058cda04028c7ebdec78a84455943a402535a2 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,17 @@ class UpgradeDetectorImpl : public UpgradeDetector { |
// True if this build is a dev or canary channel build. |
bool is_unstable_channel_; |
+ // True if group policies and platform accepts reinstalls for outdated builds. |
+ bool is_outdated_reinstall_allowed_; |
+ |
+ // The date the binaries were built. |
+ base::Time build_date_; |
+ |
+ // Remember the time received from a server request, as well as the ticks |
+ // time at that point, so we can continue to track a sane time. |
+ base::Time server_time_; |
+ base::TimeTicks server_time_ticks_; |
+ |
DISALLOW_COPY_AND_ASSIGN(UpgradeDetectorImpl); |
}; |