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 "chrome/app/vector_icons/vector_icons.h" | 9 #include "chrome/app/vector_icons/vector_icons.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 if (upgrade_available_ == UPGRADE_NEEDED_OUTDATED_INSTALL) { | 80 if (upgrade_available_ == UPGRADE_NEEDED_OUTDATED_INSTALL) { |
81 TriggerNotification(chrome::NOTIFICATION_OUTDATED_INSTALL); | 81 TriggerNotification(chrome::NOTIFICATION_OUTDATED_INSTALL); |
82 } else if (upgrade_available_ == UPGRADE_NEEDED_OUTDATED_INSTALL_NO_AU) { | 82 } else if (upgrade_available_ == UPGRADE_NEEDED_OUTDATED_INSTALL_NO_AU) { |
83 TriggerNotification(chrome::NOTIFICATION_OUTDATED_INSTALL_NO_AU); | 83 TriggerNotification(chrome::NOTIFICATION_OUTDATED_INSTALL_NO_AU); |
84 } else if (upgrade_available_ == UPGRADE_AVAILABLE_CRITICAL || | 84 } else if (upgrade_available_ == UPGRADE_AVAILABLE_CRITICAL || |
85 critical_experiment_updates_available_) { | 85 critical_experiment_updates_available_) { |
86 TriggerCriticalUpdate(); | 86 TriggerCriticalUpdate(); |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
| 90 void UpgradeDetector::NotifyUpdateOverCellularAvailable() { |
| 91 TriggerNotification(chrome::NOTIFICATION_UPDATE_OVER_CELLULAR_AVAILABLE); |
| 92 } |
| 93 |
90 void UpgradeDetector::TriggerCriticalUpdate() { | 94 void UpgradeDetector::TriggerCriticalUpdate() { |
91 const base::TimeDelta idle_timer = UseTestingIntervals() ? | 95 const base::TimeDelta idle_timer = UseTestingIntervals() ? |
92 base::TimeDelta::FromSeconds(kIdleRepeatingTimerWait) : | 96 base::TimeDelta::FromSeconds(kIdleRepeatingTimerWait) : |
93 base::TimeDelta::FromMinutes(kIdleRepeatingTimerWait); | 97 base::TimeDelta::FromMinutes(kIdleRepeatingTimerWait); |
94 idle_check_timer_.Start(FROM_HERE, idle_timer, this, | 98 idle_check_timer_.Start(FROM_HERE, idle_timer, this, |
95 &UpgradeDetector::CheckIdle); | 99 &UpgradeDetector::CheckIdle); |
96 } | 100 } |
97 | 101 |
98 void UpgradeDetector::CheckIdle() { | 102 void UpgradeDetector::CheckIdle() { |
99 // CalculateIdleState expects an interval in seconds. | 103 // CalculateIdleState expects an interval in seconds. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 break; | 135 break; |
132 case ui::IDLE_STATE_ACTIVE: | 136 case ui::IDLE_STATE_ACTIVE: |
133 case ui::IDLE_STATE_UNKNOWN: | 137 case ui::IDLE_STATE_UNKNOWN: |
134 break; | 138 break; |
135 default: | 139 default: |
136 NOTREACHED(); // Need to add any new value above (either providing | 140 NOTREACHED(); // Need to add any new value above (either providing |
137 // automatic restart or show notification to user). | 141 // automatic restart or show notification to user). |
138 break; | 142 break; |
139 } | 143 } |
140 } | 144 } |
OLD | NEW |