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

Side by Side Diff: chrome/browser/ui/webui/help/version_updater_chromeos.cc

Issue 2039273003: Cleanup: Remove VersionUpdater::RelaunchBrowser interface method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comment. Created 4 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/ui/webui/help/version_updater_chromeos.h" 5 #include "chrome/browser/ui/webui/help/version_updater_chromeos.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 check_for_update_when_idle_ = false; 149 check_for_update_when_idle_ = false;
150 150
151 // Make sure that libcros is loaded and OOBE is complete. 151 // Make sure that libcros is loaded and OOBE is complete.
152 if (!WizardController::default_controller() || 152 if (!WizardController::default_controller() ||
153 chromeos::StartupUtils::IsDeviceRegistered()) { 153 chromeos::StartupUtils::IsDeviceRegistered()) {
154 update_engine_client->RequestUpdateCheck(base::Bind( 154 update_engine_client->RequestUpdateCheck(base::Bind(
155 &VersionUpdaterCros::OnUpdateCheck, weak_ptr_factory_.GetWeakPtr())); 155 &VersionUpdaterCros::OnUpdateCheck, weak_ptr_factory_.GetWeakPtr()));
156 } 156 }
157 } 157 }
158 158
159 void VersionUpdaterCros::RelaunchBrowser() const {
160 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
161 }
162
163 void VersionUpdaterCros::SetChannel(const std::string& channel, 159 void VersionUpdaterCros::SetChannel(const std::string& channel,
164 bool is_powerwash_allowed) { 160 bool is_powerwash_allowed) {
165 OwnerSettingsServiceChromeOS* service = 161 OwnerSettingsServiceChromeOS* service =
166 context_ 162 context_
167 ? OwnerSettingsServiceChromeOSFactory::GetInstance() 163 ? OwnerSettingsServiceChromeOSFactory::GetInstance()
168 ->GetForBrowserContext(context_) 164 ->GetForBrowserContext(context_)
169 : nullptr; 165 : nullptr;
170 // For local owner set the field in the policy blob. 166 // For local owner set the field in the policy blob.
171 if (service) 167 if (service)
172 service->SetString(chromeos::kReleaseChannel, channel); 168 service->SetString(chromeos::kReleaseChannel, channel);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 249 }
254 } 250 }
255 251
256 void VersionUpdaterCros::OnUpdateCheck( 252 void VersionUpdaterCros::OnUpdateCheck(
257 UpdateEngineClient::UpdateCheckResult result) { 253 UpdateEngineClient::UpdateCheckResult result) {
258 // If version updating is not implemented, this binary is the most up-to-date 254 // If version updating is not implemented, this binary is the most up-to-date
259 // possible with respect to automatic updating. 255 // possible with respect to automatic updating.
260 if (result == UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED) 256 if (result == UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED)
261 callback_.Run(UPDATED, 0, base::string16()); 257 callback_.Run(UPDATED, 0, base::string16());
262 } 258 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/help/version_updater_chromeos.h ('k') | chrome/browser/ui/webui/help/version_updater_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698