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

Unified Diff: extensions/common/permissions/permission_message_provider.h

Issue 980353003: Extensions: Switch to new permission message system, part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 9 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/permissions/permission_message_provider.h
diff --git a/extensions/common/permissions/permission_message_provider.h b/extensions/common/permissions/permission_message_provider.h
index 942cb093acd977e342b798fbec6a1fe425e63811..3b8e5aca9f2531c2174ab3275318833668c31287 100644
--- a/extensions/common/permissions/permission_message_provider.h
+++ b/extensions/common/permissions/permission_message_provider.h
@@ -21,6 +21,9 @@ class PermissionSet;
// TODO(treib): Remove this once we've switched to the new system.
struct PermissionMessageString {
PermissionMessageString(const CoalescedPermissionMessage& message);
+ PermissionMessageString(const base::string16& message);
+ PermissionMessageString(const base::string16& message,
+ const std::vector<base::string16>& submessages);
PermissionMessageString(const base::string16& message,
const base::string16& details);
~PermissionMessageString();
@@ -30,6 +33,14 @@ struct PermissionMessageString {
};
typedef std::vector<PermissionMessageString> PermissionMessageStrings;
+enum class ForceForTesting {
+ DONT_FORCE,
+ FORCE_OLD,
+ FORCE_NEW
+};
+
+void ForcePermissionMessageSystemForTesting(ForceForTesting force);
+
// The PermissionMessageProvider interprets permissions, translating them
// into warning messages to show to the user. It also determines whether
// a new set of permissions entails showing new warning messages.
@@ -47,9 +58,9 @@ class PermissionMessageProvider {
// cmdline flag.
// TODO(treib): Remove this once we've switched to the new system, and update
// all callers to use GetCoalescedPermissionMessages directly.
- virtual PermissionMessageStrings GetPermissionMessageStrings(
+ PermissionMessageStrings GetPermissionMessageStrings(
const PermissionSet* permissions,
- Manifest::Type extension_type) const = 0;
+ Manifest::Type extension_type) const;
// Gets the legacy permission message IDs that represent this set.
// Deprecated. You DO NOT want to call this!
« no previous file with comments | « extensions/browser/api/management/management_api.cc ('k') | extensions/common/permissions/permission_message_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698