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

Unified Diff: chrome/browser/ui/webui/help/version_updater_chromeos.cc

Issue 790183002: Revert of Call to CrosSettings::Set() is replaced by OwnerSettingsService::Set() in VersionUpda... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/help/version_updater_chromeos.cc
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.cc b/chrome/browser/ui/webui/help/version_updater_chromeos.cc
index 2f10f818b4f9aee1061cdb57901eb9c38da19b45..882fbcf5e08ae1ae0956b6e09fa4c53ad67720d8 100644
--- a/chrome/browser/ui/webui/help/version_updater_chromeos.cc
+++ b/chrome/browser/ui/webui/help/version_updater_chromeos.cc
@@ -11,8 +11,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
-#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h"
-#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/ui/webui/help/help_utils_chromeos.h"
#include "chrome/grit/generated_resources.h"
@@ -22,14 +20,14 @@
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "components/user_manager/user_manager.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/base/l10n/l10n_util.h"
using chromeos::CrosSettings;
using chromeos::DBusThreadManager;
-using chromeos::OwnerSettingsServiceChromeOS;
-using chromeos::OwnerSettingsServiceChromeOSFactory;
using chromeos::UpdateEngineClient;
+using user_manager::UserManager;
using chromeos::WizardController;
namespace {
@@ -109,8 +107,8 @@ bool EnsureCanUpdate(const VersionUpdater::StatusCallback& callback) {
} // namespace
-VersionUpdater* VersionUpdater::Create(content::BrowserContext* context) {
- return new VersionUpdaterCros(context);
+VersionUpdater* VersionUpdater::Create() {
+ return new VersionUpdaterCros;
}
void VersionUpdaterCros::GetUpdateStatus(const StatusCallback& callback) {
@@ -160,14 +158,10 @@ void VersionUpdaterCros::RelaunchBrowser() const {
void VersionUpdaterCros::SetChannel(const std::string& channel,
bool is_powerwash_allowed) {
- OwnerSettingsServiceChromeOS* service =
- context_
- ? OwnerSettingsServiceChromeOSFactory::GetInstance()
- ->GetForBrowserContext(context_)
- : nullptr;
- // For local owner set the field in the policy blob.
- if (service)
- service->SetString(chromeos::kReleaseChannel, channel);
+ if (user_manager::UserManager::Get()->IsCurrentUserOwner()) {
+ // For local owner set the field in the policy blob.
+ CrosSettings::Get()->SetString(chromeos::kReleaseChannel, channel);
+ }
DBusThreadManager::Get()->GetUpdateEngineClient()->
SetChannel(channel, is_powerwash_allowed);
}
@@ -181,9 +175,8 @@ void VersionUpdaterCros::GetChannel(bool get_current_channel,
update_engine_client->GetChannel(get_current_channel, cb);
}
-VersionUpdaterCros::VersionUpdaterCros(content::BrowserContext* context)
- : context_(context),
- last_operation_(UpdateEngineClient::UPDATE_STATUS_IDLE),
+VersionUpdaterCros::VersionUpdaterCros()
+ : last_operation_(UpdateEngineClient::UPDATE_STATUS_IDLE),
check_for_update_when_idle_(false),
weak_ptr_factory_(this) {
}

Powered by Google App Engine
This is Rietveld 408576698