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

Unified Diff: extensions/common/features/feature.h

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/feature.h
diff --git a/extensions/common/features/feature.h b/extensions/common/features/feature.h
index a570b9a93f7f62db0bd4cf2880551303635fdf03..b889ef8d53913274a9740de383d47952d2095de6 100644
--- a/extensions/common/features/feature.h
+++ b/extensions/common/features/feature.h
@@ -53,6 +53,19 @@ class Feature {
SERVICE_WORKER_CONTEXT,
};
+ // Classes of session types to which features can be restricted in feature
+ // files. The session type describes session based on the type of user that is
+ // active in the current session.
+ enum SessionType {
+ SESSION_TYPE_UNSPECIFIED,
+ // Regular session, i.e. non kiosk app.
+ SESSION_TYPE_REGULAR,
+ // Kiosk app session.
+ SESSION_TYPE_KIOSK,
+ // Helper for determining max enum value - not used as a real type.
+ SESSION_TYPE_MAX = SESSION_TYPE_KIOSK
+ };
+
// The platforms the feature is supported in.
enum Platform {
UNSPECIFIED_PLATFORM,
@@ -136,11 +149,14 @@ class Feature {
// extension and context.
Availability IsAvailableToContext(const Extension* extension,
Context context,
+ SessionType session_type,
const GURL& url) const {
- return IsAvailableToContext(extension, context, url, GetCurrentPlatform());
+ return IsAvailableToContext(extension, context, session_type, url,
+ GetCurrentPlatform());
}
virtual Availability IsAvailableToContext(const Extension* extension,
Context context,
+ SessionType session_type,
const GURL& url,
Platform platform) const = 0;

Powered by Google App Engine
This is Rietveld 408576698