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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 shell_integration::DefaultWebClientState state) { | 1142 shell_integration::DefaultWebClientState state) { |
1143 int status_string_id; | 1143 int status_string_id; |
1144 | 1144 |
1145 if (state == shell_integration::IS_DEFAULT) { | 1145 if (state == shell_integration::IS_DEFAULT) { |
1146 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; | 1146 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; |
1147 // Notify the user in the future if Chrome ceases to be the user's chosen | 1147 // Notify the user in the future if Chrome ceases to be the user's chosen |
1148 // default browser. | 1148 // default browser. |
1149 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 1149 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
1150 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); | 1150 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); |
1151 } else if (state == shell_integration::NOT_DEFAULT) { | 1151 } else if (state == shell_integration::NOT_DEFAULT) { |
1152 if (shell_integration::CanSetAsDefaultBrowser() == | 1152 if (shell_integration::CanSetAsDefaultBrowser()) { |
1153 shell_integration::SET_DEFAULT_NOT_ALLOWED) { | 1153 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
| 1154 } else { |
1154 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_SXS; | 1155 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_SXS; |
1155 } else { | |
1156 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | |
1157 } | 1156 } |
1158 } else if (state == shell_integration::UNKNOWN_DEFAULT) { | 1157 } else if (state == shell_integration::UNKNOWN_DEFAULT) { |
1159 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 1158 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
1160 } else { | 1159 } else { |
1161 NOTREACHED(); | 1160 NOTREACHED(); |
1162 return; | 1161 return; |
1163 } | 1162 } |
1164 | 1163 |
1165 SetDefaultBrowserUIString(status_string_id); | 1164 SetDefaultBrowserUIString(status_string_id); |
1166 } | 1165 } |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2138 | 2137 |
2139 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2138 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
2140 #if defined(OS_CHROMEOS) | 2139 #if defined(OS_CHROMEOS) |
2141 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2140 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
2142 #else | 2141 #else |
2143 return true; | 2142 return true; |
2144 #endif | 2143 #endif |
2145 } | 2144 } |
2146 | 2145 |
2147 } // namespace options | 2146 } // namespace options |
OLD | NEW |