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_H_ | 5 #ifndef CHROME_BROWSER_UPGRADE_DETECTOR_H_ |
6 #define CHROME_BROWSER_UPGRADE_DETECTOR_H_ | 6 #define CHROME_BROWSER_UPGRADE_DETECTOR_H_ |
7 | 7 |
8 #include "base/timer.h" | 8 #include "base/timer.h" |
9 #include "chrome/browser/idle.h" | 9 #include "chrome/browser/idle.h" |
10 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
11 | 11 |
12 class PrefService; | 12 class PrefServiceSimple; |
13 | 13 |
14 /////////////////////////////////////////////////////////////////////////////// | 14 /////////////////////////////////////////////////////////////////////////////// |
15 // UpgradeDetector | 15 // UpgradeDetector |
16 // | 16 // |
17 // This class is a singleton class that monitors when an upgrade happens in the | 17 // This class is a singleton class that monitors when an upgrade happens in the |
18 // background. We basically ask Omaha what it thinks the latest version is and | 18 // background. We basically ask Omaha what it thinks the latest version is and |
19 // if our version is lower we send out a notification upon: | 19 // if our version is lower we send out a notification upon: |
20 // a) Detecting an upgrade and... | 20 // a) Detecting an upgrade and... |
21 // b) When we think the user should be notified about the upgrade. | 21 // b) When we think the user should be notified about the upgrade. |
22 // The latter happens much later, since we don't want to be too annoying. | 22 // The latter happens much later, since we don't want to be too annoying. |
(...skipping 14 matching lines...) Expand all Loading... |
37 enum UpgradeNotificationIconType { | 37 enum UpgradeNotificationIconType { |
38 UPGRADE_ICON_TYPE_BADGE = 0, // For overlay badging of the wrench menu. | 38 UPGRADE_ICON_TYPE_BADGE = 0, // For overlay badging of the wrench menu. |
39 UPGRADE_ICON_TYPE_MENU_ICON, // For showing in the wrench menu. | 39 UPGRADE_ICON_TYPE_MENU_ICON, // For showing in the wrench menu. |
40 }; | 40 }; |
41 | 41 |
42 // Returns the singleton implementation instance. | 42 // Returns the singleton implementation instance. |
43 static UpgradeDetector* GetInstance(); | 43 static UpgradeDetector* GetInstance(); |
44 | 44 |
45 virtual ~UpgradeDetector(); | 45 virtual ~UpgradeDetector(); |
46 | 46 |
47 static void RegisterPrefs(PrefService* prefs); | 47 static void RegisterPrefs(PrefServiceSimple* prefs); |
48 | 48 |
49 // Whether the user should be notified about an upgrade. | 49 // Whether the user should be notified about an upgrade. |
50 bool notify_upgrade() const { return notify_upgrade_; } | 50 bool notify_upgrade() const { return notify_upgrade_; } |
51 | 51 |
52 // Whether the upgrade is a critical upgrade (such as a zero-day update). | 52 // Whether the upgrade is a critical upgrade (such as a zero-day update). |
53 bool is_critical_update() const { return is_critical_upgrade_; } | 53 bool is_critical_update() const { return is_critical_upgrade_; } |
54 | 54 |
55 // Notifify this object that the user has acknowledged the critical update | 55 // Notifify this object that the user has acknowledged the critical update |
56 // so we don't need to complain about it for now. | 56 // so we don't need to complain about it for now. |
57 void acknowledge_critical_update() { | 57 void acknowledge_critical_update() { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 UpgradeNotificationAnnoyanceLevel upgrade_notification_stage_; | 118 UpgradeNotificationAnnoyanceLevel upgrade_notification_stage_; |
119 | 119 |
120 // Whether we have waited long enough after detecting an upgrade (to see | 120 // Whether we have waited long enough after detecting an upgrade (to see |
121 // is we should start nagging about upgrading). | 121 // is we should start nagging about upgrading). |
122 bool notify_upgrade_; | 122 bool notify_upgrade_; |
123 | 123 |
124 DISALLOW_COPY_AND_ASSIGN(UpgradeDetector); | 124 DISALLOW_COPY_AND_ASSIGN(UpgradeDetector); |
125 }; | 125 }; |
126 | 126 |
127 #endif // CHROME_BROWSER_UPGRADE_DETECTOR_H_ | 127 #endif // CHROME_BROWSER_UPGRADE_DETECTOR_H_ |
OLD | NEW |