| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 bool owner_managed) { | 2127 bool owner_managed) { |
| 2128 web_ui()->CallJavascriptFunction( | 2128 web_ui()->CallJavascriptFunction( |
| 2129 "BrowserOptions.setMetricsReportingCheckboxState", | 2129 "BrowserOptions.setMetricsReportingCheckboxState", |
| 2130 base::FundamentalValue(checked), base::FundamentalValue(policy_managed), | 2130 base::FundamentalValue(checked), base::FundamentalValue(policy_managed), |
| 2131 base::FundamentalValue(owner_managed)); | 2131 base::FundamentalValue(owner_managed)); |
| 2132 } | 2132 } |
| 2133 | 2133 |
| 2134 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2134 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
| 2135 const policy::PolicyMap& previous, | 2135 const policy::PolicyMap& previous, |
| 2136 const policy::PolicyMap& current) { | 2136 const policy::PolicyMap& current) { |
| 2137 std::set<std::string> different_keys; | 2137 std::set<std::string> different_key_names; |
| 2138 current.GetDifferingKeys(previous, &different_keys); | 2138 current.GetDifferingKeyNames(previous, &different_key_names); |
| 2139 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2139 if (ContainsKey(different_key_names, policy::key::kMetricsReportingEnabled)) |
| 2140 SetupMetricsReportingCheckbox(); | 2140 SetupMetricsReportingCheckbox(); |
| 2141 } | 2141 } |
| 2142 | 2142 |
| 2143 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2143 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
| 2144 #if defined(OS_CHROMEOS) | 2144 #if defined(OS_CHROMEOS) |
| 2145 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2145 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
| 2146 #else | 2146 #else |
| 2147 return true; | 2147 return true; |
| 2148 #endif | 2148 #endif |
| 2149 } | 2149 } |
| 2150 | 2150 |
| 2151 } // namespace options | 2151 } // namespace options |
| OLD | NEW |