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 #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 "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // be, we assume it is for testing and switch to using seconds instead of | 26 // be, we assume it is for testing and switch to using seconds instead of |
27 // hours. | 27 // hours. |
28 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); | 28 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); |
29 return !cmd_line.GetSwitchValueASCII( | 29 return !cmd_line.GetSwitchValueASCII( |
30 switches::kCheckForUpdateIntervalSec).empty(); | 30 switches::kCheckForUpdateIntervalSec).empty(); |
31 } | 31 } |
32 | 32 |
33 // static | 33 // static |
34 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { | 34 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { |
35 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); | 35 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); |
| 36 prefs->RegisterBooleanPref(prefs::kWasRestarted, false); |
36 } | 37 } |
37 | 38 |
38 int UpgradeDetector::GetIconResourceID(UpgradeNotificationIconType type) { | 39 int UpgradeDetector::GetIconResourceID(UpgradeNotificationIconType type) { |
39 bool badge = type == UPGRADE_ICON_TYPE_BADGE; | 40 bool badge = type == UPGRADE_ICON_TYPE_BADGE; |
40 switch (upgrade_notification_stage_) { | 41 switch (upgrade_notification_stage_) { |
41 case UPGRADE_ANNOYANCE_CRITICAL: | 42 case UPGRADE_ANNOYANCE_CRITICAL: |
42 // The critical annoyance state, somewhat ironically, re-purposes the | 43 // The critical annoyance state, somewhat ironically, re-purposes the |
43 // icon for the second highest severity state, since that state has the | 44 // icon for the second highest severity state, since that state has the |
44 // icon most closely resembling the one requested of this feature and the | 45 // icon most closely resembling the one requested of this feature and the |
45 // critical annoyance is never part of the sliding scale of severity | 46 // critical annoyance is never part of the sliding scale of severity |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 break; | 119 break; |
119 case IDLE_STATE_ACTIVE: | 120 case IDLE_STATE_ACTIVE: |
120 case IDLE_STATE_UNKNOWN: | 121 case IDLE_STATE_UNKNOWN: |
121 break; | 122 break; |
122 default: | 123 default: |
123 NOTREACHED(); // Need to add any new value above (either providing | 124 NOTREACHED(); // Need to add any new value above (either providing |
124 // automatic restart or show notification to user). | 125 // automatic restart or show notification to user). |
125 break; | 126 break; |
126 } | 127 } |
127 } | 128 } |
OLD | NEW |