| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ |
| 6 #define CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ | 6 #define CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 static void DetectUpgradeTask( | 72 static void DetectUpgradeTask( |
| 73 base::WeakPtr<UpgradeDetectorImpl> upgrade_detector); | 73 base::WeakPtr<UpgradeDetectorImpl> upgrade_detector); |
| 74 | 74 |
| 75 // We periodically check to see if Chrome has been upgraded. | 75 // We periodically check to see if Chrome has been upgraded. |
| 76 base::RepeatingTimer<UpgradeDetectorImpl> detect_upgrade_timer_; | 76 base::RepeatingTimer<UpgradeDetectorImpl> detect_upgrade_timer_; |
| 77 | 77 |
| 78 // After we detect an upgrade we start a recurring timer to see if enough time | 78 // After we detect an upgrade we start a recurring timer to see if enough time |
| 79 // has passed and we should start notifying the user. | 79 // has passed and we should start notifying the user. |
| 80 base::RepeatingTimer<UpgradeDetectorImpl> upgrade_notification_timer_; | 80 base::RepeatingTimer<UpgradeDetectorImpl> upgrade_notification_timer_; |
| 81 | 81 |
| 82 // We use this factory to create callback tasks for UpgradeDetected. We pass | |
| 83 // the task to the actual upgrade detection code, which is in | |
| 84 // DetectUpgradeTask. | |
| 85 base::WeakPtrFactory<UpgradeDetectorImpl> weak_factory_; | |
| 86 | |
| 87 // True if this build is a dev or canary channel build. | 82 // True if this build is a dev or canary channel build. |
| 88 bool is_unstable_channel_; | 83 bool is_unstable_channel_; |
| 89 | 84 |
| 90 // True if auto update is turned on. | 85 // True if auto update is turned on. |
| 91 bool is_auto_update_enabled_; | 86 bool is_auto_update_enabled_; |
| 92 | 87 |
| 93 // When the upgrade was detected - either a software update or a variations | 88 // When the upgrade was detected - either a software update or a variations |
| 94 // update, whichever happened first. | 89 // update, whichever happened first. |
| 95 base::TimeTicks upgrade_detected_time_; | 90 base::TimeTicks upgrade_detected_time_; |
| 96 | 91 |
| 97 // The date the binaries were built. | 92 // The date the binaries were built. |
| 98 base::Time build_date_; | 93 base::Time build_date_; |
| 99 | 94 |
| 95 // We use this factory to create callback tasks for UpgradeDetected. We pass |
| 96 // the task to the actual upgrade detection code, which is in |
| 97 // DetectUpgradeTask. |
| 98 base::WeakPtrFactory<UpgradeDetectorImpl> weak_factory_; |
| 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(UpgradeDetectorImpl); | 100 DISALLOW_COPY_AND_ASSIGN(UpgradeDetectorImpl); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ | 104 #endif // CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ |
| OLD | NEW |