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

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: 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 1a069357e29dc4563f5fb8b86c67b20d0a4e7eb4..e737602cbf147337430bea111c1ce352ea6514ea 100644
--- a/chrome/browser/ui/webui/help/help_handler.cc
+++ b/chrome/browser/ui/webui/help/help_handler.cc
@@ -37,8 +37,6 @@ using base::ListValue;
namespace {
-const char kDomainChangable[] = "domain";
-
// Returns the browser version as a string.
string16 BuildBrowserVersionString() {
chrome::VersionInfo version_info;
@@ -69,9 +67,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 = "";
@@ -230,10 +228,12 @@ 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);
+ // For local owner set the field in the policy blob too.
Joao da Silva 2012/03/09 15:15:55 Please drop a comment explaining why IsCurrentUser
pastarmovj 2012/03/12 13:06:53 Done.
+ if (chromeos::UserManager::Get()->IsCurrentUserOwner()) {
+ chromeos::CrosSettings::Get()->SetString(chromeos::kReleaseChannel,
+ channel);
+ }
}
#endif // defined(OS_CHROMEOS)

Powered by Google App Engine
This is Rietveld 408576698