| 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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 default_browser_worker_->StartCheckIsDefault(); | 1076 default_browser_worker_->StartCheckIsDefault(); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) { | 1079 void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) { |
| 1080 // If the default browser setting is managed then we should not be able to | 1080 // If the default browser setting is managed then we should not be able to |
| 1081 // call this function. | 1081 // call this function. |
| 1082 if (default_browser_policy_.IsManaged()) | 1082 if (default_browser_policy_.IsManaged()) |
| 1083 return; | 1083 return; |
| 1084 | 1084 |
| 1085 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); | 1085 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); |
| 1086 UMA_HISTOGRAM_COUNTS("Settings.StartSetAsDefault", true); |
| 1087 |
| 1088 // Callback takes care of updating UI. |
| 1086 default_browser_worker_->StartSetAsDefault(); | 1089 default_browser_worker_->StartSetAsDefault(); |
| 1087 // Callback takes care of updating UI. | |
| 1088 | 1090 |
| 1089 // If the user attempted to make Chrome the default browser, notify | 1091 // If the user attempted to make Chrome the default browser, notify |
| 1090 // them when this changes. | 1092 // them when this changes. |
| 1091 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 1093 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1092 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); | 1094 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); |
| 1093 } | 1095 } |
| 1094 | 1096 |
| 1095 int BrowserOptionsHandler::StatusStringIdForState( | 1097 int BrowserOptionsHandler::StatusStringIdForState( |
| 1096 ShellIntegration::DefaultWebClientState state) { | 1098 ShellIntegration::DefaultWebClientState state) { |
| 1097 if (state == ShellIntegration::IS_DEFAULT) | 1099 if (state == ShellIntegration::IS_DEFAULT) |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2111 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2113 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
| 2112 const policy::PolicyMap& previous, | 2114 const policy::PolicyMap& previous, |
| 2113 const policy::PolicyMap& current) { | 2115 const policy::PolicyMap& current) { |
| 2114 std::set<std::string> different_keys; | 2116 std::set<std::string> different_keys; |
| 2115 current.GetDifferingKeys(previous, &different_keys); | 2117 current.GetDifferingKeys(previous, &different_keys); |
| 2116 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2118 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
| 2117 SetupMetricsReportingCheckbox(); | 2119 SetupMetricsReportingCheckbox(); |
| 2118 } | 2120 } |
| 2119 | 2121 |
| 2120 } // namespace options | 2122 } // namespace options |
| OLD | NEW |