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/saved_files_service.h" | 8 #include "apps/saved_files_service.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 extension_data->Set("dependentExtensions", dependents_list); | 336 extension_data->Set("dependentExtensions", dependents_list); |
337 | 337 |
338 // We show the "all urls" checkbox if: | 338 // We show the "all urls" checkbox if: |
339 // - The feature is enabled for the given extension, or has been set in the | 339 // - The feature is enabled for the given extension, or has been set in the |
340 // past. | 340 // past. |
341 // - The extension has access to enough urls that we can't just let it run | 341 // - The extension has access to enough urls that we can't just let it run |
342 // on those specified in the permissions. | 342 // on those specified in the permissions. |
343 content::BrowserContext* context = extension_service_->GetBrowserContext(); | 343 content::BrowserContext* context = extension_service_->GetBrowserContext(); |
344 bool show_all_urls = | 344 bool show_all_urls = |
345 (FeatureSwitch::scripts_require_action()->IsEnabled() && | 345 (FeatureSwitch::scripts_require_action()->IsEnabled() && |
346 util::ScriptsMayRequireActionForExtension( | 346 PermissionsData::ScriptsMayRequireActionForExtension( |
347 extension, | 347 extension, |
348 extension->permissions_data()->active_permissions().get())) || | 348 extension->permissions_data()->active_permissions().get())) || |
349 extension->permissions_data()->HasWithheldImpliedAllHosts() || | 349 extension->permissions_data()->HasWithheldImpliedAllHosts() || |
350 util::HasSetAllowedScriptingOnAllUrls(extension->id(), context); | 350 util::HasSetAllowedScriptingOnAllUrls(extension->id(), context); |
351 extension_data->SetBoolean("showAllUrls", show_all_urls); | 351 extension_data->SetBoolean("showAllUrls", show_all_urls); |
352 extension_data->SetBoolean( | 352 extension_data->SetBoolean( |
353 "allowAllUrls", | 353 "allowAllUrls", |
354 util::AllowedScriptingOnAllUrls(extension->id(), context)); | 354 util::AllowedScriptingOnAllUrls(extension->id(), context)); |
355 | 355 |
356 base::string16 location_text; | 356 base::string16 location_text; |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 extension_service_->EnableExtension(extension_id); | 1532 extension_service_->EnableExtension(extension_id); |
1533 } else { | 1533 } else { |
1534 ExtensionErrorReporter::GetInstance()->ReportError( | 1534 ExtensionErrorReporter::GetInstance()->ReportError( |
1535 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1535 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1536 true); // Be noisy. | 1536 true); // Be noisy. |
1537 } | 1537 } |
1538 requirements_checker_.reset(); | 1538 requirements_checker_.reset(); |
1539 } | 1539 } |
1540 | 1540 |
1541 } // namespace extensions | 1541 } // namespace extensions |
OLD | NEW |