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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2028 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { | 2028 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { |
2029 bool has_users = !Profile::FromWebUI(web_ui())-> | 2029 bool has_users = !Profile::FromWebUI(web_ui())-> |
2030 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); | 2030 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); |
2031 base::FundamentalValue has_users_value(has_users); | 2031 base::FundamentalValue has_users_value(has_users); |
2032 web_ui()->CallJavascriptFunction( | 2032 web_ui()->CallJavascriptFunction( |
2033 "BrowserOptions.updateManagesSupervisedUsers", | 2033 "BrowserOptions.updateManagesSupervisedUsers", |
2034 has_users_value); | 2034 has_users_value); |
2035 } | 2035 } |
2036 | 2036 |
2037 void BrowserOptionsHandler::SetupEasyUnlock() { | 2037 void BrowserOptionsHandler::SetupEasyUnlock() { |
2038 // TODO(isherman): Is the below TODO still relevant? | |
2038 // TODO(xiyuan): Update when pairing data is really availble. | 2039 // TODO(xiyuan): Update when pairing data is really availble. |
Ilya Sherman
2015/02/05 02:27:50
Xiyuan, could you please clarify what you meant by
xiyuan
2015/02/05 03:30:09
The TODO could be removed. It is done. We were che
| |
2039 const base::ListValue* devices = | 2040 base::FundamentalValue is_enabled( |
2040 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->GetRemoteDevices(); | 2041 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsEnabled()); |
2041 bool has_pairing = devices && !devices->empty(); | |
2042 base::FundamentalValue has_pairing_value(has_pairing); | |
2043 web_ui()->CallJavascriptFunction( | 2042 web_ui()->CallJavascriptFunction( |
2044 "BrowserOptions.updateEasyUnlock", | 2043 "BrowserOptions.updateEasyUnlock", |
2045 has_pairing_value); | 2044 is_enabled); |
2046 } | 2045 } |
2047 | 2046 |
2048 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { | 2047 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { |
2049 #if defined(OS_WIN) | 2048 #if defined(OS_WIN) |
2050 base::DictionaryValue extension_controlled; | 2049 base::DictionaryValue extension_controlled; |
2051 | 2050 |
2052 // Check if an extension is overriding the Search Engine. | 2051 // Check if an extension is overriding the Search Engine. |
2053 const extensions::Extension* extension = | 2052 const extensions::Extension* extension = |
2054 extensions::GetExtensionOverridingSearchEngine( | 2053 extensions::GetExtensionOverridingSearchEngine( |
2055 Profile::FromWebUI(web_ui())); | 2054 Profile::FromWebUI(web_ui())); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2129 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2128 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
2130 const policy::PolicyMap& previous, | 2129 const policy::PolicyMap& previous, |
2131 const policy::PolicyMap& current) { | 2130 const policy::PolicyMap& current) { |
2132 std::set<std::string> different_keys; | 2131 std::set<std::string> different_keys; |
2133 current.GetDifferingKeys(previous, &different_keys); | 2132 current.GetDifferingKeys(previous, &different_keys); |
2134 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2133 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
2135 SetupMetricsReportingCheckbox(); | 2134 SetupMetricsReportingCheckbox(); |
2136 } | 2135 } |
2137 | 2136 |
2138 } // namespace options | 2137 } // namespace options |
OLD | NEW |