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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 HotwordServiceFactory::IsHotwordAllowed(profile)) { | 1786 HotwordServiceFactory::IsHotwordAllowed(profile)) { |
1787 // Update the current error value. | 1787 // Update the current error value. |
1788 HotwordServiceFactory::IsServiceAvailable(profile); | 1788 HotwordServiceFactory::IsServiceAvailable(profile); |
1789 int error = HotwordServiceFactory::GetCurrentError(profile); | 1789 int error = HotwordServiceFactory::GetCurrentError(profile); |
1790 | 1790 |
1791 std::string function_name; | 1791 std::string function_name; |
1792 bool always_on = false; | 1792 bool always_on = false; |
1793 SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); | 1793 SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); |
1794 bool authenticated = signin && signin->IsAuthenticated(); | 1794 bool authenticated = signin && signin->IsAuthenticated(); |
1795 if (HotwordService::IsExperimentalHotwordingEnabled()) { | 1795 if (HotwordService::IsExperimentalHotwordingEnabled()) { |
1796 if (HotwordServiceFactory::IsHotwordHardwareAvailable() && | 1796 if (HotwordServiceFactory::IsAlwaysOnAvailable() && |
1797 authenticated) { | 1797 authenticated) { |
1798 function_name = "BrowserOptions.showHotwordAlwaysOnSection"; | 1798 function_name = "BrowserOptions.showHotwordAlwaysOnSection"; |
1799 always_on = true; | 1799 always_on = true; |
1800 // Show the retrain link if always-on is enabled. | 1800 // Show the retrain link if always-on is enabled. |
1801 if (profile->GetPrefs()->GetBoolean( | 1801 if (profile->GetPrefs()->GetBoolean( |
1802 prefs::kHotwordAlwaysOnSearchEnabled)) { | 1802 prefs::kHotwordAlwaysOnSearchEnabled)) { |
1803 web_ui()->CallJavascriptFunction( | 1803 web_ui()->CallJavascriptFunction( |
1804 "BrowserOptions.setHotwordRetrainLinkVisible", | 1804 "BrowserOptions.setHotwordRetrainLinkVisible", |
1805 base::FundamentalValue(true)); | 1805 base::FundamentalValue(true)); |
1806 } | 1806 } |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2182 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
2183 const policy::PolicyMap& previous, | 2183 const policy::PolicyMap& previous, |
2184 const policy::PolicyMap& current) { | 2184 const policy::PolicyMap& current) { |
2185 std::set<std::string> different_keys; | 2185 std::set<std::string> different_keys; |
2186 current.GetDifferingKeys(previous, &different_keys); | 2186 current.GetDifferingKeys(previous, &different_keys); |
2187 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2187 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
2188 SetupMetricsReportingCheckbox(); | 2188 SetupMetricsReportingCheckbox(); |
2189 } | 2189 } |
2190 | 2190 |
2191 } // namespace options | 2191 } // namespace options |
OLD | NEW |