summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authororitm@chromium.org <oritm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 20:53:04 +0000
committeroritm@chromium.org <oritm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 20:53:04 +0000
commit276bf3ba4d8827c010ac7338fb3883f5313517b0 (patch)
tree60dd05b97e4df22b772d22be86536df99642de81 /chrome
parent5b363b62b900139bee78a99628c0090020ccbaa9 (diff)
downloadchromium_src-276bf3ba4d8827c010ac7338fb3883f5313517b0.zip
chromium_src-276bf3ba4d8827c010ac7338fb3883f5313517b0.tar.gz
chromium_src-276bf3ba4d8827c010ac7338fb3883f5313517b0.tar.bz2
Merge 121292 - Make sure that the timezone settings are editable by any user.
When the device settings refactoring was done this setting was treated like any other system setting and made available only to the owner or to no one if the device was enterprise enrolled. However this should be made editable by everyone at least until we get proper system settings delegation when we might be able to enforce some stricter policy on that setting. BUG=chromium-os:24450 TEST=As described in the bug. Review URL: http://codereview.chromium.org/9316093 TBR=pastarmovj@chromium.org Review URL: https://chromiumcodereview.appspot.com/9378019 git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@121522 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc17
-rw-r--r--chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler2.cc17
2 files changed, 30 insertions, 4 deletions
diff --git a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
index 80d9aaa..d240062 100644
--- a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -32,6 +32,17 @@ namespace chromeos {
namespace {
+// List of settings that should be changeable by all users.
+const char* kNonOwnerSettings[] = {
+ kSystemTimezone
+};
+
+// Returns true if |pref| should be only available to the owner.
+bool IsSettingOwnerOnly(const std::string& pref) {
+ const char** end = kNonOwnerSettings + arraysize(kNonOwnerSettings);
+ return std::find(kNonOwnerSettings, end, pref) == end;
+}
+
// Create a settings value with "managed" and "disabled" property.
// "managed" property is true if the setting is managed by administrator.
// "disabled" property is true if the UI for the setting should be disabled.
@@ -151,10 +162,12 @@ base::Value* CoreChromeOSOptionsHandler::FetchPref(
return pref_value->DeepCopy();
}
// All other prefs are decorated the same way.
+ bool enabled = (UserManager::Get()->current_user_is_owner() ||
+ !IsSettingOwnerOnly(pref_name));
return CreateSettingsValue(
pref_value->DeepCopy(), // The copy will be owned by the dictionary.
g_browser_process->browser_policy_connector()->IsEnterpriseManaged(),
- !UserManager::Get()->current_user_is_owner());
+ !enabled);
}
void CoreChromeOSOptionsHandler::ObservePref(const std::string& pref_name) {
diff --git a/chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler2.cc b/chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler2.cc
index aa1ed24..f2067cd 100644
--- a/chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler2.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -31,6 +31,17 @@ namespace options2 {
namespace {
+// List of settings that should be changeable by all users.
+const char* kNonOwnerSettings[] = {
+ kSystemTimezone
+};
+
+// Returns true if |pref| should be only available to the owner.
+bool IsSettingOwnerOnly(const std::string& pref) {
+ const char** end = kNonOwnerSettings + arraysize(kNonOwnerSettings);
+ return std::find(kNonOwnerSettings, end, pref) == end;
+}
+
// Create a settings value with "managed" and "disabled" property.
// "managed" property is true if the setting is managed by administrator.
// "disabled" property is true if the UI for the setting should be disabled.
@@ -150,10 +161,12 @@ base::Value* CoreChromeOSOptionsHandler::FetchPref(
return pref_value->DeepCopy();
}
// All other prefs are decorated the same way.
+ bool enabled = (UserManager::Get()->current_user_is_owner() ||
+ !IsSettingOwnerOnly(pref_name));
return CreateSettingsValue(
pref_value->DeepCopy(), // The copy will be owned by the dictionary.
g_browser_process->browser_policy_connector()->IsEnterpriseManaged(),
- !UserManager::Get()->current_user_is_owner());
+ !enabled);
}
void CoreChromeOSOptionsHandler::ObservePref(const std::string& pref_name) {