| 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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 default_browser_worker_->StartCheckIsDefault(); | 1128 default_browser_worker_->StartCheckIsDefault(); |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) { | 1131 void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) { |
| 1132 // If the default browser setting is managed then we should not be able to | 1132 // If the default browser setting is managed then we should not be able to |
| 1133 // call this function. | 1133 // call this function. |
| 1134 if (default_browser_policy_.IsManaged()) | 1134 if (default_browser_policy_.IsManaged()) |
| 1135 return; | 1135 return; |
| 1136 | 1136 |
| 1137 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); | 1137 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); |
| 1138 UMA_HISTOGRAM_COUNTS("Settings.StartSetAsDefault", 1); |
| 1139 |
| 1140 // Callback takes care of updating UI. |
| 1138 default_browser_worker_->StartSetAsDefault(); | 1141 default_browser_worker_->StartSetAsDefault(); |
| 1139 // Callback takes care of updating UI. | |
| 1140 | 1142 |
| 1141 // If the user attempted to make Chrome the default browser, notify | 1143 // If the user attempted to make Chrome the default browser, notify |
| 1142 // them when this changes. | 1144 // them when this changes. |
| 1143 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 1145 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1144 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); | 1146 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); |
| 1145 } | 1147 } |
| 1146 | 1148 |
| 1147 int BrowserOptionsHandler::StatusStringIdForState( | 1149 int BrowserOptionsHandler::StatusStringIdForState( |
| 1148 ShellIntegration::DefaultWebClientState state) { | 1150 ShellIntegration::DefaultWebClientState state) { |
| 1149 if (state == ShellIntegration::IS_DEFAULT) | 1151 if (state == ShellIntegration::IS_DEFAULT) |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2186 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
| 2185 const policy::PolicyMap& previous, | 2187 const policy::PolicyMap& previous, |
| 2186 const policy::PolicyMap& current) { | 2188 const policy::PolicyMap& current) { |
| 2187 std::set<std::string> different_keys; | 2189 std::set<std::string> different_keys; |
| 2188 current.GetDifferingKeys(previous, &different_keys); | 2190 current.GetDifferingKeys(previous, &different_keys); |
| 2189 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2191 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
| 2190 SetupMetricsReportingCheckbox(); | 2192 SetupMetricsReportingCheckbox(); |
| 2191 } | 2193 } |
| 2192 | 2194 |
| 2193 } // namespace options | 2195 } // namespace options |
| OLD | NEW |