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

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

Issue 9668001: Add a new policy to allow for release channel delegation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToT rebase. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/help/help_handler.cc
diff --git a/chrome/browser/ui/webui/help/help_handler.cc b/chrome/browser/ui/webui/help/help_handler.cc
index 82d5f3e238b67fe6c8beb1cb88130fc309a12348..613e1ca97bf948dc79f34028aded0081e461da42 100644
--- a/chrome/browser/ui/webui/help/help_handler.cc
+++ b/chrome/browser/ui/webui/help/help_handler.cc
@@ -42,8 +42,6 @@ using base::ListValue;
namespace {
-const char kDomainChangable[] = "domain";
-
// Returns the browser version as a string.
string16 BuildBrowserVersionString() {
chrome::VersionInfo version_info;
@@ -74,9 +72,9 @@ bool CanChangeReleaseChannel() {
// On a managed machine we delegate this setting to the users of the same
// domain only if the policy value is "domain".
if (g_browser_process->browser_policy_connector()->IsEnterpriseManaged()) {
- std::string value;
- chromeos::CrosSettings::Get()->GetString(chromeos::kReleaseChannel, &value);
- if (value != kDomainChangable)
+ bool value = false;
+ if (!chromeos::CrosSettings::Get()->GetBoolean(
+ chromeos::kReleaseChannelDelegated, &value) || !value)
return false;
// Get the currently logged in user and strip the domain part only.
std::string domain = "";
@@ -260,10 +258,15 @@ void HelpHandler::SetReleaseTrack(const ListValue* args) {
}
const std::string channel = UTF16ToUTF8(ExtractStringValue(args));
- Profile* profile = Profile::FromWebUI(web_ui());
- PrefService* prefs = profile->GetPrefs();
- prefs->SetString("cros.system.releaseChannel", channel);
version_updater_->SetReleaseChannel(channel);
+ // On enterprise machines we can only use SetReleaseChannel to store the
+ // user choice in the lsb-release file but we can not modify the policy blob.
+ // Therefore we only call SetString if the device is locally owned and the
+ // currently logged in user is the owner.
+ if (chromeos::UserManager::Get()->IsCurrentUserOwner()) {
+ chromeos::CrosSettings::Get()->SetString(chromeos::kReleaseChannel,
+ channel);
+ }
}
#endif // defined(OS_CHROMEOS)
« no previous file with comments | « chrome/browser/policy/proto/chrome_device_policy.proto ('k') | chrome/browser/ui/webui/options/chromeos/about_page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698