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

Unified Diff: extensions/common/features/simple_feature.cc

Issue 443723003: extensions: Register 'app' and 'webstore' bindings only if they are available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: extensions/common/features/simple_feature.cc
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc
index e623bcf47d7661c48a2080f85d590f3b9cfc0a48..3dba373c954343b60ccc0926ff1d2dd389c271d2 100644
--- a/extensions/common/features/simple_feature.cc
+++ b/extensions/common/features/simple_feature.cc
@@ -17,6 +17,7 @@
#include "base/strings/stringprintf.h"
#include "extensions/common/extension_api.h"
#include "extensions/common/features/feature_provider.h"
+#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
namespace extensions {
@@ -406,7 +407,9 @@ Feature::Availability SimpleFeature::IsAvailableToContext(
// Fewer surprises, and if the feature configuration wants to isolate
// "matches" from say "blessed_extension" then they can use complex features.
if ((context == WEB_PAGE_CONTEXT || context == WEBUI_CONTEXT) &&
- !matches_.MatchesURL(url)) {
+ (!matches_.MatchesURL(url) ||
+ (url.is_valid() &&
sadrul 2014/08/06 18:51:51 The check for url.is_valid() is here because Exten
not at google - send to devlin 2014/08/06 22:10:28 damn, it looks like this check is breaking the web
+ PermissionsData::IsRestrictedUrl(url, url, extension, NULL)))) {
return CreateAvailability(INVALID_URL, url);
}

Powered by Google App Engine
This is Rietveld 408576698