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

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

Issue 2241203003: Pass user session type to extension feature checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split out some stuff Created 4 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 37a0c80dc2572469423bd7d6ceb31b2d15ca6067..c7c66f4848004bbc023685a8d160606a59568811 100644
--- a/extensions/common/features/simple_feature.cc
+++ b/extensions/common/features/simple_feature.cc
@@ -45,12 +45,15 @@ Feature::Availability IsAvailableToManifestForBind(
extension_id, type, location, manifest_version, platform);
}
-Feature::Availability IsAvailableToContextForBind(const Extension* extension,
- Feature::Context context,
- const GURL& url,
- Feature::Platform platform,
- const Feature* feature) {
- return feature->IsAvailableToContext(extension, context, url, platform);
+Feature::Availability IsAvailableToContextForBind(
+ const Extension* extension,
+ Feature::Context context,
+ Feature::SessionType session_type,
+ const GURL& url,
+ Feature::Platform platform,
+ const Feature* feature) {
+ return feature->IsAvailableToContext(extension, context, session_type, url,
+ platform);
}
// TODO(aa): Can we replace all this manual parsing with JSON schema stuff?
@@ -448,7 +451,8 @@ Feature::Availability SimpleFeature::IsAvailableToManifest(
Feature::Availability SimpleFeature::IsAvailableToContext(
const Extension* extension,
- SimpleFeature::Context context,
+ Feature::Context context,
+ Feature::SessionType session_type,
const GURL& url,
SimpleFeature::Platform platform) const {
if (extension) {
@@ -478,8 +482,8 @@ Feature::Availability SimpleFeature::IsAvailableToContext(
// TODO(kalman): Assert that if the context was a webpage or WebUI context
// then at some point a "matches" restriction was checked.
- return CheckDependencies(base::Bind(
- &IsAvailableToContextForBind, extension, context, url, platform));
+ return CheckDependencies(base::Bind(&IsAvailableToContextForBind, extension,
+ context, session_type, url, platform));
}
std::string SimpleFeature::GetAvailabilityMessage(

Powered by Google App Engine
This is Rietveld 408576698