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

Unified Diff: chrome/browser/chromeos/policy/device_local_account_policy_provider.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browsertest and removed unnecessary string for default values. Created 5 years, 4 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/chromeos/policy/device_local_account_policy_provider.cc
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc b/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc
index ca40ec6395be301d49a17859bd5a98cda41f179d..979b3af57323f2b06d42dee21a01247b460c03f3 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc
@@ -56,36 +56,27 @@ DeviceLocalAccountPolicyProvider::Create(
// suspend while leaving the session running, which is not desirable for
// public sessions.
chrome_policy_overrides->Set(
- key::kLidCloseAction,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_MACHINE,
+ key::kLidCloseAction, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
Thiemo Nagel 2015/09/01 17:40:35 Please try to avoid reformatting existing code.
fhorschig 2015/09/04 06:53:53 Done.
new base::FundamentalValue(
chromeos::PowerPolicyController::ACTION_STOP_SESSION),
- NULL);
+ NULL, POLICY_SOURCE_PLATFORM);
Thiemo Nagel 2015/09/01 17:40:35 I'd consider defining a different source for this
fhorschig 2015/09/04 06:53:53 Done. Enforced policies are now of type ENFORCED.
// Force the |ShelfAutoHideBehavior| policy to |Never|, ensuring that the
// ash shelf does not auto-hide.
- chrome_policy_overrides->Set(
- key::kShelfAutoHideBehavior,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_MACHINE,
- new base::StringValue("Never"),
- NULL);
+ chrome_policy_overrides->Set(key::kShelfAutoHideBehavior,
+ POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
+ new base::StringValue("Never"), NULL,
+ POLICY_SOURCE_PLATFORM);
Thiemo Nagel 2015/09/01 17:40:35 see above
fhorschig 2015/09/04 06:53:53 Done.
// Force the |ShowLogoutButtonInTray| policy to |true|, ensuring that a big,
// red logout button is shown in the ash system tray.
- chrome_policy_overrides->Set(
- key::kShowLogoutButtonInTray,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_MACHINE,
- new base::FundamentalValue(true),
- NULL);
+ chrome_policy_overrides->Set(key::kShowLogoutButtonInTray,
+ POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
+ new base::FundamentalValue(true), NULL,
+ POLICY_SOURCE_PLATFORM);
Thiemo Nagel 2015/09/01 17:40:35 see above
fhorschig 2015/09/04 06:53:53 Done.
// Force the |FullscreenAllowed| policy to |false|, ensuring that the ash
// shelf cannot be hidden by entering fullscreen mode.
chrome_policy_overrides->Set(
- key::kFullscreenAllowed,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_MACHINE,
- new base::FundamentalValue(false),
- NULL);
+ key::kFullscreenAllowed, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
+ new base::FundamentalValue(false), NULL, POLICY_SOURCE_PLATFORM);
Thiemo Nagel 2015/09/01 17:40:35 see above
fhorschig 2015/09/04 06:53:53 Done.
}
scoped_ptr<DeviceLocalAccountPolicyProvider> provider(
@@ -118,6 +109,10 @@ void DeviceLocalAccountPolicyProvider::RefreshPolicies() {
}
}
+PolicySource DeviceLocalAccountPolicyProvider::source() const {
Thiemo Nagel 2015/09/01 17:40:35 Remove.
fhorschig 2015/09/04 06:53:52 Done.
+ return POLICY_SOURCE_PLATFORM;
+}
+
void DeviceLocalAccountPolicyProvider::OnPolicyUpdated(
const std::string& user_id) {
if (user_id == user_id_)
@@ -170,8 +165,8 @@ void DeviceLocalAccountPolicyProvider::UpdateFromBroker() {
it != chrome_policy_overrides_->end();
++it) {
const PolicyMap::Entry& entry = it->second;
- chrome_policy.Set(
- it->first, entry.level, entry.scope, entry.value->DeepCopy(), NULL);
+ chrome_policy.Set(it->first, entry.level, entry.scope,
+ entry.value->DeepCopy(), NULL, POLICY_SOURCE_PLATFORM);
}
}

Powered by Google App Engine
This is Rietveld 408576698