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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 Manifest::IsUnpackedLocation(extension->location())); | 253 Manifest::IsUnpackedLocation(extension->location())); |
254 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app()); | 254 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app()); |
255 extension_data->SetBoolean("is_platform_app", extension->is_platform_app()); | 255 extension_data->SetBoolean("is_platform_app", extension->is_platform_app()); |
256 extension_data->SetBoolean("homepageProvided", | 256 extension_data->SetBoolean("homepageProvided", |
257 ManifestURL::GetHomepageURL(extension).is_valid()); | 257 ManifestURL::GetHomepageURL(extension).is_valid()); |
258 | 258 |
259 // Extensions only want all URL access if: | 259 // Extensions only want all URL access if: |
260 // - The feature is enabled. | 260 // - The feature is enabled. |
261 // - The extension has access to enough urls that we can't just let it run | 261 // - The extension has access to enough urls that we can't just let it run |
262 // on those specified in the permissions. | 262 // on those specified in the permissions. |
263 bool wants_all_urls = FeatureSwitch::scripts_require_action()->IsEnabled() && | 263 bool wants_all_urls = |
264 PermissionsData::ForExtension(extension) | 264 FeatureSwitch::scripts_require_action()->IsEnabled() && |
265 ->RequiresActionForScriptExecution(extension); | 265 extension->permissions_data()->RequiresActionForScriptExecution( |
| 266 extension); |
266 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); | 267 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); |
267 extension_data->SetBoolean( | 268 extension_data->SetBoolean( |
268 "allowAllUrls", | 269 "allowAllUrls", |
269 util::AllowedScriptingOnAllUrls( | 270 util::AllowedScriptingOnAllUrls( |
270 extension->id(), | 271 extension->id(), |
271 extension_service_->GetBrowserContext())); | 272 extension_service_->GetBrowserContext())); |
272 | 273 |
273 base::string16 location_text; | 274 base::string16 location_text; |
274 if (Manifest::IsPolicyLocation(extension->location())) { | 275 if (Manifest::IsPolicyLocation(extension->location())) { |
275 location_text = l10n_util::GetStringUTF16( | 276 location_text = l10n_util::GetStringUTF16( |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 extension_service_->EnableExtension(extension_id); | 1320 extension_service_->EnableExtension(extension_id); |
1320 } else { | 1321 } else { |
1321 ExtensionErrorReporter::GetInstance()->ReportError( | 1322 ExtensionErrorReporter::GetInstance()->ReportError( |
1322 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1323 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1323 true); // Be noisy. | 1324 true); // Be noisy. |
1324 } | 1325 } |
1325 requirements_checker_.reset(); | 1326 requirements_checker_.reset(); |
1326 } | 1327 } |
1327 | 1328 |
1328 } // namespace extensions | 1329 } // namespace extensions |
OLD | NEW |