Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: chrome/browser/chromeos/upgrade_detector_chromeos.cc

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Add DISALLOW_COPY_AND_ASSIGN Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/chromeos/upgrade_detector_chromeos.h" 5 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } else if (time_passed >= kHighThreshold) { 125 } else if (time_passed >= kHighThreshold) {
126 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_HIGH); 126 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_HIGH);
127 } else if (time_passed >= kElevatedThreshold) { 127 } else if (time_passed >= kElevatedThreshold) {
128 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_ELEVATED); 128 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_ELEVATED);
129 } else if (time_passed >= kLowThreshold) { 129 } else if (time_passed >= kLowThreshold) {
130 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_LOW); 130 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_LOW);
131 } else { 131 } else {
132 return; // Not ready to recommend upgrade. 132 return; // Not ready to recommend upgrade.
133 } 133 }
134 134
135 NotifyUpgradeRecommended(); 135 NotifyUpgrade();
136 } 136 }
137 137
138 void UpgradeDetectorChromeos::OnChannelsReceived( 138 void UpgradeDetectorChromeos::OnChannelsReceived(
139 const std::string& current_channel, 139 const std::string& current_channel,
140 const std::string& target_channel) { 140 const std::string& target_channel) {
141 // As current update engine status is UPDATE_STATUS_UPDATED_NEED_REBOOT 141 // As current update engine status is UPDATE_STATUS_UPDATED_NEED_REBOOT
142 // and target channel is more stable than current channel, powerwash 142 // and target channel is more stable than current channel, powerwash
143 // will be performed after reboot. 143 // will be performed after reboot.
144 set_is_factory_reset_required(UpdateEngineClient::IsTargetChannelMoreStable( 144 set_is_factory_reset_required(UpdateEngineClient::IsTargetChannelMoreStable(
145 current_channel, target_channel)); 145 current_channel, target_channel));
(...skipping 11 matching lines...) Expand all
157 157
158 // static 158 // static
159 UpgradeDetectorChromeos* UpgradeDetectorChromeos::GetInstance() { 159 UpgradeDetectorChromeos* UpgradeDetectorChromeos::GetInstance() {
160 return base::Singleton<UpgradeDetectorChromeos>::get(); 160 return base::Singleton<UpgradeDetectorChromeos>::get();
161 } 161 }
162 162
163 // static 163 // static
164 UpgradeDetector* UpgradeDetector::GetInstance() { 164 UpgradeDetector* UpgradeDetector::GetInstance() {
165 return UpgradeDetectorChromeos::GetInstance(); 165 return UpgradeDetectorChromeos::GetInstance();
166 } 166 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_notification_types.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698