Chromium Code Reviews| Index: chrome/browser/upgrade_detector.h |
| diff --git a/chrome/browser/upgrade_detector.h b/chrome/browser/upgrade_detector.h |
| index c05f88ae287dab23fe0a9a5b928b08260da245e9..a919888697232f44cf51ffaefaf8817981a3e046 100644 |
| --- a/chrome/browser/upgrade_detector.h |
| +++ b/chrome/browser/upgrade_detector.h |
| @@ -52,6 +52,13 @@ class UpgradeDetector { |
| // Whether the upgrade is a critical upgrade (such as a zero-day update). |
| bool is_critical_update() const { return is_critical_upgrade_; } |
| + // Whether the upgrade is a outdated Chrome (no updates for too long). |
| + bool IsOutdatedInstall() const { |
|
Finnur
2013/01/24 10:13:33
Are you sure we consider one && and one ! so heavy
MAD
2013/01/24 17:29:35
I thought hacker style was just when we return the
|
| + // Critical upgrade have precedence over outdated because it means we |
| + // successfully installed a critical upgrade, so no need to reinstall. |
| + return is_outdated_install_ && !is_critical_upgrade_; |
| + } |
| + |
| // Notifify this object that the user has acknowledged the critical update |
| // so we don't need to complain about it for now. |
| void acknowledge_critical_update() { |
| @@ -96,6 +103,10 @@ class UpgradeDetector { |
| // fix. |
| bool is_critical_upgrade_; |
| + // True if no update to Chrome has been installed for more than the allowed |
| + // time, which means updating keeps failing, so a reinstall can be suggested. |
| + bool is_outdated_install_; |
| + |
| // Whether the user has acknowledged the critical update. |
| bool critical_update_acknowledged_; |
| @@ -111,7 +122,8 @@ class UpgradeDetector { |
| base::Time upgrade_detected_time_; |
| // A timer to check to see if we've been idle for long enough to show the |
| - // critical warning. Should only be set if |is_critical_upgrade_| is true. |
| + // critical warning. Should only be set if |is_critical_upgrade_| or |
| + // |is_outdated_install_| is true. |
| base::RepeatingTimer<UpgradeDetector> idle_check_timer_; |
| // The stage at which the annoyance level for upgrade notifications is at. |