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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) { | 1124 void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) { |
1125 // If the default browser setting is managed then we should not be able to | 1125 // If the default browser setting is managed then we should not be able to |
1126 // call this function. | 1126 // call this function. |
1127 if (default_browser_policy_.IsManaged()) | 1127 if (default_browser_policy_.IsManaged()) |
1128 return; | 1128 return; |
1129 | 1129 |
1130 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); | 1130 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); |
1131 default_browser_worker_->StartSetAsDefault(); | 1131 default_browser_worker_->StartSetAsDefault(); |
1132 // Callback takes care of updating UI. | 1132 // Callback takes care of updating UI. |
1133 | 1133 |
1134 // If the user attempted to make Chrome the default browser, then he/she | 1134 // If the user attempted to make Chrome the default browser, notify |
1135 // arguably wants to be notified when that changes. | 1135 // them when this changes. |
1136 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 1136 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
1137 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); | 1137 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); |
1138 } | 1138 } |
1139 | 1139 |
1140 int BrowserOptionsHandler::StatusStringIdForState( | 1140 int BrowserOptionsHandler::StatusStringIdForState( |
1141 ShellIntegration::DefaultWebClientState state) { | 1141 ShellIntegration::DefaultWebClientState state) { |
1142 if (state == ShellIntegration::IS_DEFAULT) | 1142 if (state == ShellIntegration::IS_DEFAULT) |
1143 return IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; | 1143 return IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; |
1144 if (state == ShellIntegration::NOT_DEFAULT) | 1144 if (state == ShellIntegration::NOT_DEFAULT) |
1145 return IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | 1145 return IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2172 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
2173 const policy::PolicyMap& previous, | 2173 const policy::PolicyMap& previous, |
2174 const policy::PolicyMap& current) { | 2174 const policy::PolicyMap& current) { |
2175 std::set<std::string> different_keys; | 2175 std::set<std::string> different_keys; |
2176 current.GetDifferingKeys(previous, &different_keys); | 2176 current.GetDifferingKeys(previous, &different_keys); |
2177 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2177 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
2178 SetupMetricsReportingCheckbox(); | 2178 SetupMetricsReportingCheckbox(); |
2179 } | 2179 } |
2180 | 2180 |
2181 } // namespace options | 2181 } // namespace options |
OLD | NEW |