| 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 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 return IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | 1142 return IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
| 1143 return IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 1143 return IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 void BrowserOptionsHandler::SetDefaultWebClientUIState( | 1146 void BrowserOptionsHandler::SetDefaultWebClientUIState( |
| 1147 ShellIntegration::DefaultWebClientUIState state) { | 1147 ShellIntegration::DefaultWebClientUIState state) { |
| 1148 int status_string_id; | 1148 int status_string_id; |
| 1149 | 1149 |
| 1150 if (state == ShellIntegration::STATE_IS_DEFAULT) { | 1150 if (state == ShellIntegration::STATE_IS_DEFAULT) { |
| 1151 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; | 1151 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; |
| 1152 // Notify the user in the future if Chrome ceases to be the user's chosen |
| 1153 // default browser. |
| 1154 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1155 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); |
| 1152 } else if (state == ShellIntegration::STATE_NOT_DEFAULT) { | 1156 } else if (state == ShellIntegration::STATE_NOT_DEFAULT) { |
| 1153 if (ShellIntegration::CanSetAsDefaultBrowser() == | 1157 if (ShellIntegration::CanSetAsDefaultBrowser() == |
| 1154 ShellIntegration::SET_DEFAULT_NOT_ALLOWED) { | 1158 ShellIntegration::SET_DEFAULT_NOT_ALLOWED) { |
| 1155 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_SXS; | 1159 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_SXS; |
| 1156 } else { | 1160 } else { |
| 1157 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | 1161 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
| 1158 } | 1162 } |
| 1159 } else if (state == ShellIntegration::STATE_UNKNOWN) { | 1163 } else if (state == ShellIntegration::STATE_UNKNOWN) { |
| 1160 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 1164 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
| 1161 } else { | 1165 } else { |
| (...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2169 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2173 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
| 2170 const policy::PolicyMap& previous, | 2174 const policy::PolicyMap& previous, |
| 2171 const policy::PolicyMap& current) { | 2175 const policy::PolicyMap& current) { |
| 2172 std::set<std::string> different_keys; | 2176 std::set<std::string> different_keys; |
| 2173 current.GetDifferingKeys(previous, &different_keys); | 2177 current.GetDifferingKeys(previous, &different_keys); |
| 2174 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2178 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
| 2175 SetupMetricsReportingCheckbox(); | 2179 SetupMetricsReportingCheckbox(); |
| 2176 } | 2180 } |
| 2177 | 2181 |
| 2178 } // namespace options | 2182 } // namespace options |
| OLD | NEW |