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

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 889153004: [Cleanup] Clean up Easy Unlock code a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and remove TODOs Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_signin_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(xiyuan): Update when pairing data is really availble. 2038 base::FundamentalValue is_enabled(
2039 const base::ListValue* devices = 2039 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsEnabled());
2040 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->GetRemoteDevices();
2041 bool has_pairing = devices && !devices->empty();
2042 base::FundamentalValue has_pairing_value(has_pairing);
2043 web_ui()->CallJavascriptFunction( 2040 web_ui()->CallJavascriptFunction(
2044 "BrowserOptions.updateEasyUnlock", 2041 "BrowserOptions.updateEasyUnlock",
2045 has_pairing_value); 2042 is_enabled);
2046 } 2043 }
2047 2044
2048 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { 2045 void BrowserOptionsHandler::SetupExtensionControlledIndicators() {
2049 #if defined(OS_WIN) 2046 #if defined(OS_WIN)
2050 base::DictionaryValue extension_controlled; 2047 base::DictionaryValue extension_controlled;
2051 2048
2052 // Check if an extension is overriding the Search Engine. 2049 // Check if an extension is overriding the Search Engine.
2053 const extensions::Extension* extension = 2050 const extensions::Extension* extension =
2054 extensions::GetExtensionOverridingSearchEngine( 2051 extensions::GetExtensionOverridingSearchEngine(
2055 Profile::FromWebUI(web_ui())); 2052 Profile::FromWebUI(web_ui()));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, 2126 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns,
2130 const policy::PolicyMap& previous, 2127 const policy::PolicyMap& previous,
2131 const policy::PolicyMap& current) { 2128 const policy::PolicyMap& current) {
2132 std::set<std::string> different_keys; 2129 std::set<std::string> different_keys;
2133 current.GetDifferingKeys(previous, &different_keys); 2130 current.GetDifferingKeys(previous, &different_keys);
2134 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) 2131 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled))
2135 SetupMetricsReportingCheckbox(); 2132 SetupMetricsReportingCheckbox();
2136 } 2133 }
2137 2134
2138 } // namespace options 2135 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_signin_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698