OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/upgrade_detector.h" | 5 #include "chrome/browser/upgrade_detector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 switches::kCheckForUpdateIntervalSec).empty(); | 31 switches::kCheckForUpdateIntervalSec).empty(); |
32 } | 32 } |
33 | 33 |
34 // static | 34 // static |
35 void UpgradeDetector::RegisterPrefs(PrefRegistrySimple* registry) { | 35 void UpgradeDetector::RegisterPrefs(PrefRegistrySimple* registry) { |
36 registry->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); | 36 registry->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); |
37 registry->RegisterBooleanPref(prefs::kWasRestarted, false); | 37 registry->RegisterBooleanPref(prefs::kWasRestarted, false); |
38 registry->RegisterBooleanPref(prefs::kAttemptedToEnableAutoupdate, false); | 38 registry->RegisterBooleanPref(prefs::kAttemptedToEnableAutoupdate, false); |
39 } | 39 } |
40 | 40 |
41 int UpgradeDetector::GetIconResourceID(UpgradeNotificationIconType type) { | 41 int UpgradeDetector::GetIconResourceID() { |
42 if (type == UPGRADE_ICON_TYPE_BADGE) { | |
43 // TODO(oshima): Badges no longer exist. remove this. | |
44 NOTREACHED(); | |
45 return 0; | |
46 } | |
47 | |
48 switch (upgrade_notification_stage_) { | 42 switch (upgrade_notification_stage_) { |
49 case UPGRADE_ANNOYANCE_NONE: | 43 case UPGRADE_ANNOYANCE_NONE: |
50 return 0; | 44 return 0; |
51 case UPGRADE_ANNOYANCE_LOW: | 45 case UPGRADE_ANNOYANCE_LOW: |
52 return IDR_UPDATE_MENU_SEVERITY_LOW; | 46 return IDR_UPDATE_MENU_SEVERITY_LOW; |
53 case UPGRADE_ANNOYANCE_ELEVATED: | 47 case UPGRADE_ANNOYANCE_ELEVATED: |
54 return IDR_UPDATE_MENU_SEVERITY_MEDIUM; | 48 return IDR_UPDATE_MENU_SEVERITY_MEDIUM; |
55 case UPGRADE_ANNOYANCE_HIGH: | 49 case UPGRADE_ANNOYANCE_HIGH: |
56 return IDR_UPDATE_MENU_SEVERITY_HIGH; | 50 return IDR_UPDATE_MENU_SEVERITY_HIGH; |
57 case UPGRADE_ANNOYANCE_SEVERE: | 51 case UPGRADE_ANNOYANCE_SEVERE: |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 break; | 141 break; |
148 case IDLE_STATE_ACTIVE: | 142 case IDLE_STATE_ACTIVE: |
149 case IDLE_STATE_UNKNOWN: | 143 case IDLE_STATE_UNKNOWN: |
150 break; | 144 break; |
151 default: | 145 default: |
152 NOTREACHED(); // Need to add any new value above (either providing | 146 NOTREACHED(); // Need to add any new value above (either providing |
153 // automatic restart or show notification to user). | 147 // automatic restart or show notification to user). |
154 break; | 148 break; |
155 } | 149 } |
156 } | 150 } |
OLD | NEW |