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/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
9 #include "apps/app_window.h" | 9 #include "apps/app_window.h" |
10 #include "apps/app_window_registry.h" | 10 #include "apps/app_window_registry.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 Manifest::IsUnpackedLocation(extension->location())); | 255 Manifest::IsUnpackedLocation(extension->location())); |
256 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app()); | 256 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app()); |
257 extension_data->SetBoolean("is_platform_app", extension->is_platform_app()); | 257 extension_data->SetBoolean("is_platform_app", extension->is_platform_app()); |
258 extension_data->SetBoolean("homepageProvided", | 258 extension_data->SetBoolean("homepageProvided", |
259 ManifestURL::GetHomepageURL(extension).is_valid()); | 259 ManifestURL::GetHomepageURL(extension).is_valid()); |
260 | 260 |
261 // Extensions only want all URL access if: | 261 // Extensions only want all URL access if: |
262 // - The feature is enabled. | 262 // - The feature is enabled. |
263 // - The extension has access to enough urls that we can't just let it run | 263 // - The extension has access to enough urls that we can't just let it run |
264 // on those specified in the permissions. | 264 // on those specified in the permissions. |
265 bool wants_all_urls = | 265 bool wants_all_urls = extension->permissions_data()->HasWithheldAllHosts(); |
266 FeatureSwitch::scripts_require_action()->IsEnabled() && | |
267 extension->permissions_data()->RequiresActionForScriptExecution( | |
268 extension); | |
269 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); | 266 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); |
270 extension_data->SetBoolean( | 267 extension_data->SetBoolean( |
271 "allowAllUrls", | 268 "allowAllUrls", |
272 util::AllowedScriptingOnAllUrls( | 269 util::AllowedScriptingOnAllUrls( |
273 extension->id(), | 270 extension->id(), |
274 extension_service_->GetBrowserContext())); | 271 extension_service_->GetBrowserContext())); |
275 | 272 |
276 base::string16 location_text; | 273 base::string16 location_text; |
277 if (Manifest::IsPolicyLocation(extension->location())) { | 274 if (Manifest::IsPolicyLocation(extension->location())) { |
278 location_text = l10n_util::GetStringUTF16( | 275 location_text = l10n_util::GetStringUTF16( |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 extension_service_->EnableExtension(extension_id); | 1342 extension_service_->EnableExtension(extension_id); |
1346 } else { | 1343 } else { |
1347 ExtensionErrorReporter::GetInstance()->ReportError( | 1344 ExtensionErrorReporter::GetInstance()->ReportError( |
1348 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1345 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1349 true); // Be noisy. | 1346 true); // Be noisy. |
1350 } | 1347 } |
1351 requirements_checker_.reset(); | 1348 requirements_checker_.reset(); |
1352 } | 1349 } |
1353 | 1350 |
1354 } // namespace extensions | 1351 } // namespace extensions |
OLD | NEW |