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

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

Issue 2925893002: [Merge to M60] Fix crash of update-over-cellular icon (Closed)
Patch Set: 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
« no previous file with comments | « ash/system/update/tray_update.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (status.status == UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { 95 if (status.status == UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) {
96 upgrade_detected_time_ = base::Time::Now(); 96 upgrade_detected_time_ = base::Time::Now();
97 97
98 channels_requester_.reset(new UpgradeDetectorChromeos::ChannelsRequester()); 98 channels_requester_.reset(new UpgradeDetectorChromeos::ChannelsRequester());
99 channels_requester_->RequestChannels( 99 channels_requester_->RequestChannels(
100 base::Bind(&UpgradeDetectorChromeos::OnChannelsReceived, 100 base::Bind(&UpgradeDetectorChromeos::OnChannelsReceived,
101 weak_factory_.GetWeakPtr())); 101 weak_factory_.GetWeakPtr()));
102 } else if (status.status == 102 } else if (status.status ==
103 UpdateEngineClient::UPDATE_STATUS_NEED_PERMISSION_TO_UPDATE) { 103 UpdateEngineClient::UPDATE_STATUS_NEED_PERMISSION_TO_UPDATE) {
104 // Update engine broadcasts this state only when update is available but 104 // Update engine broadcasts this state only when update is available but
105 // downloading over cellular connection requires user's agreement 105 // downloading over cellular connection requires user's agreement.
106 NotifyUpdateOverCellularAvailable(); 106 NotifyUpdateOverCellularAvailable();
107 } 107 }
108 } 108 }
109 109
110 void UpgradeDetectorChromeos::NotifyOnUpgrade() { 110 void UpgradeDetectorChromeos::NotifyOnUpgrade() {
111 base::TimeDelta delta = base::Time::Now() - upgrade_detected_time_; 111 base::TimeDelta delta = base::Time::Now() - upgrade_detected_time_;
112 int64_t time_passed = delta.InDays(); 112 int64_t time_passed = delta.InDays();
113 113
114 const int kSevereThreshold = 7; 114 const int kSevereThreshold = 7;
115 const int kHighThreshold = 4; 115 const int kHighThreshold = 4;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 | « ash/system/update/tray_update.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698