Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 874683005: [Extensions] Enable the scripts-require-action feature based on all-urls pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 dependent_entry->SetString("id", (*i)->id()); 331 dependent_entry->SetString("id", (*i)->id());
332 dependent_entry->SetString("name", (*i)->name()); 332 dependent_entry->SetString("name", (*i)->name());
333 dependents_list->Append(dependent_entry); 333 dependents_list->Append(dependent_entry);
334 } 334 }
335 } 335 }
336 extension_data->Set("dependentExtensions", dependents_list); 336 extension_data->Set("dependentExtensions", dependents_list);
337 337
338 // Extensions only want all URL access if: 338 // Extensions only want all URL access if:
339 // - The feature is enabled for the given extension. 339 // - The feature is enabled for the given extension.
340 // - The extension has access to enough urls that we can't just let it run 340 // - The extension has access to enough urls that we can't just let it run
341 // on those specified in the permissions. 341 // on those specified in the permissions.
not at google - send to devlin 2015/02/06 00:26:56 The comment and/or this variable name need updatin
Devlin 2015/02/06 18:58:43 Done.
342 bool wants_all_urls = 342 bool wants_all_urls =
343 util::ScriptsMayRequireActionForExtension(extension) && 343 (FeatureSwitch::scripts_require_action()->IsEnabled() &&
344 (extension->permissions_data()->HasWithheldImpliedAllHosts() || 344 util::ScriptsMayRequireActionForExtension(
345 util::AllowedScriptingOnAllUrls( 345 extension, extension->permissions_data()->active_permissions())) ||
346 extension->id(), extension_service_->GetBrowserContext())); 346 extension->permissions_data()->HasWithheldImpliedAllHosts();
347 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); 347 extension_data->SetBoolean("wantsAllUrls", wants_all_urls);
348 extension_data->SetBoolean( 348 extension_data->SetBoolean(
349 "allowAllUrls", 349 "allowAllUrls",
350 util::AllowedScriptingOnAllUrls( 350 util::AllowedScriptingOnAllUrls(
351 extension->id(), 351 extension->id(),
352 extension_service_->GetBrowserContext())); 352 extension_service_->GetBrowserContext()));
353 353
354 base::string16 location_text; 354 base::string16 location_text;
355 if (extension->location() == Manifest::INTERNAL && 355 if (extension->location() == Manifest::INTERNAL &&
356 !ManifestURL::UpdatesFromGallery(extension)) { 356 !ManifestURL::UpdatesFromGallery(extension)) {
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 extension_service_->EnableExtension(extension_id); 1530 extension_service_->EnableExtension(extension_id);
1531 } else { 1531 } else {
1532 ExtensionErrorReporter::GetInstance()->ReportError( 1532 ExtensionErrorReporter::GetInstance()->ReportError(
1533 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1533 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1534 true); // Be noisy. 1534 true); // Be noisy.
1535 } 1535 }
1536 requirements_checker_.reset(); 1536 requirements_checker_.reset();
1537 } 1537 }
1538 1538
1539 } // namespace extensions 1539 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698