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 #include <string> | 10 #include <string> |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 BrowserOptionsHandler::BrowserOptionsHandler() | 178 BrowserOptionsHandler::BrowserOptionsHandler() |
179 : page_initialized_(false), | 179 : page_initialized_(false), |
180 template_url_service_(NULL), | 180 template_url_service_(NULL), |
181 cloud_print_mdns_ui_enabled_(false), | 181 cloud_print_mdns_ui_enabled_(false), |
182 #if defined(OS_CHROMEOS) | 182 #if defined(OS_CHROMEOS) |
183 enable_factory_reset_(false), | 183 enable_factory_reset_(false), |
184 #endif // defined(OS_CHROMEOS) | 184 #endif // defined(OS_CHROMEOS) |
185 signin_observer_(this), | 185 signin_observer_(this), |
186 weak_ptr_factory_(this) { | 186 weak_ptr_factory_(this) { |
187 default_browser_worker_ = new ShellIntegration::DefaultBrowserWorker(this); | 187 default_browser_worker_ = |
| 188 new ShellIntegration::DefaultBrowserWorker(this, false); |
188 | 189 |
189 #if defined(ENABLE_SERVICE_DISCOVERY) | 190 #if defined(ENABLE_SERVICE_DISCOVERY) |
190 cloud_print_mdns_ui_enabled_ = true; | 191 cloud_print_mdns_ui_enabled_ = true; |
191 #endif // defined(ENABLE_SERVICE_DISCOVERY) | 192 #endif // defined(ENABLE_SERVICE_DISCOVERY) |
192 } | 193 } |
193 | 194 |
194 BrowserOptionsHandler::~BrowserOptionsHandler() { | 195 BrowserOptionsHandler::~BrowserOptionsHandler() { |
195 ProfileSyncService* sync_service(ProfileSyncServiceFactory:: | 196 ProfileSyncService* sync_service(ProfileSyncServiceFactory:: |
196 GetInstance()->GetForProfile(Profile::FromWebUI(web_ui()))); | 197 GetInstance()->GetForProfile(Profile::FromWebUI(web_ui()))); |
197 if (sync_service) | 198 if (sync_service) |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 } | 1128 } |
1128 } else if (state == ShellIntegration::STATE_UNKNOWN) { | 1129 } else if (state == ShellIntegration::STATE_UNKNOWN) { |
1129 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 1130 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
1130 } else { | 1131 } else { |
1131 return; // Still processing. | 1132 return; // Still processing. |
1132 } | 1133 } |
1133 | 1134 |
1134 SetDefaultBrowserUIString(status_string_id); | 1135 SetDefaultBrowserUIString(status_string_id); |
1135 } | 1136 } |
1136 | 1137 |
1137 bool BrowserOptionsHandler::IsInteractiveSetDefaultPermitted() { | |
1138 return true; // This is UI so we can allow it. | |
1139 } | |
1140 | |
1141 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) { | 1138 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) { |
1142 base::StringValue status_string( | 1139 base::StringValue status_string( |
1143 l10n_util::GetStringFUTF16(status_string_id, | 1140 l10n_util::GetStringFUTF16(status_string_id, |
1144 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 1141 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
1145 | 1142 |
1146 base::FundamentalValue is_default( | 1143 base::FundamentalValue is_default( |
1147 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT); | 1144 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT); |
1148 | 1145 |
1149 base::FundamentalValue can_be_default( | 1146 base::FundamentalValue can_be_default( |
1150 !default_browser_policy_.IsManaged() && | 1147 !default_browser_policy_.IsManaged() && |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2135 | 2132 |
2136 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2133 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
2137 #if defined(OS_CHROMEOS) | 2134 #if defined(OS_CHROMEOS) |
2138 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2135 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
2139 #else | 2136 #else |
2140 return true; | 2137 return true; |
2141 #endif | 2138 #endif |
2142 } | 2139 } |
2143 | 2140 |
2144 } // namespace options | 2141 } // namespace options |
OLD | NEW |