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

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

Issue 1213623006: Extensions: Remove PermissionMessage (permission_message.h/cc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kill_getmessages
Patch Set: fix app_shell build, rebase Created 5 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/permissions/permission_message.h
diff --git a/extensions/common/permissions/permission_message.h b/extensions/common/permissions/permission_message.h
deleted file mode 100644
index e4df834943d5740f5e4926dc164b86ebd0e4d1ac..0000000000000000000000000000000000000000
--- a/extensions/common/permissions/permission_message.h
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_H_
-#define EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/strings/string16.h"
-
-namespace extensions {
-
-// When prompting the user to install or approve permissions, we display
-// messages describing the effects of the permissions rather than listing the
-// permissions themselves. Each PermissionMessage represents one of the
-// messages shown to the user.
-class PermissionMessage {
- public:
- // Do not reorder this enumeration. If you need to add a new enum, add it just
- // prior to kEnumBoundary.
- // TODO(sashab): Deprecate these IDs - use whatever APIPermission::ID becomes
- // instead.
- enum ID {
- kUnknown,
- kNone,
- kBookmarks,
- kGeolocation,
- kBrowsingHistory,
- kTabs,
- kManagement,
- kDebugger,
- kDesktopCapture,
- kHid,
- kHosts1,
- kHosts2,
- kHosts3,
- kHosts4OrMore,
- kHostsAll,
- kFullAccess,
- kClipboard,
- kTtsEngine,
- kContentSettings,
- kPrivacy,
- kSupervisedUser,
- kInput,
- kAudioCapture,
- kVideoCapture,
- kDownloads,
- kDeleted_FileSystemWrite,
- kMediaGalleriesAllGalleriesRead,
- kSerial,
- kSocketAnyHost,
- kSocketDomainHosts,
- kSocketSpecificHosts,
- kBluetooth,
- kUsb,
- kSystemIndicator,
- kUsbDevice,
- kMediaGalleriesAllGalleriesCopyTo,
- kSystemInfoDisplay,
- kNativeMessaging,
- kSyncFileSystem,
- kAudio,
- kFavicon,
- kMusicManagerPrivate,
- kWebConnectable,
- kActivityLogPrivate,
- kBluetoothDevices,
- kDownloadsOpen,
- kNetworkingPrivate,
- kDeclarativeWebRequest,
- kFileSystemDirectory,
- kFileSystemWriteDirectory,
- kSignedInDevices,
- kWallpaper,
- kNetworkState,
- kHomepage,
- kSearchProvider,
- kStartupPages,
- kMediaGalleriesAllGalleriesDelete,
- kScreenlockPrivate,
- kOverrideBookmarksUI,
- kAutomation,
- kAccessibilityFeaturesModify,
- kAccessibilityFeaturesRead,
- kBluetoothPrivate,
- kIdentityEmail,
- kExperienceSamplingPrivate,
- kCopresence,
- kTopSites,
- kU2fDevices,
- kDocumentScan,
- kNetworkingConfig,
- kPlatformKeys,
- kMDns,
- kVpnProvider,
- kHosts1ReadOnly,
- kHosts2ReadOnly,
- kHosts3ReadOnly,
- kHosts4OrMoreReadOnly,
- kHostsAllReadOnly,
- kInterceptAllKeys,
- kSettingsPrivate,
- kPrinterProvider,
- kSearchEnginesPrivate,
- kAutofillPrivate,
- kPasswordsPrivate,
- kUsersPrivate,
- // Last entry: Add new entries above.
- kEnumBoundary,
- };
- static_assert(PermissionMessage::kNone > PermissionMessage::kUnknown,
- "kNone should not greater than kUnknown");
-
- // Creates the corresponding permission message.
- PermissionMessage(ID id, const base::string16& message);
- PermissionMessage(ID id,
- const base::string16& message,
- const base::string16& details);
- ~PermissionMessage();
-
- // Gets the id of the permission message, which can be used in UMA
- // histograms.
- ID id() const { return id_; }
-
- // Gets a localized message describing this permission. Please note that
- // the message will be empty for message types TYPE_NONE and TYPE_UNKNOWN.
- const base::string16& message() const { return message_; }
-
- // Gets a localized message describing the details for this permission. Please
- // note that the message will be empty for message types TYPE_NONE and
- // TYPE_UNKNOWN.
- const base::string16& details() const { return details_; }
-
- // Comparator to work with std::set.
- bool operator<(const PermissionMessage& that) const {
- return id_ < that.id_;
- }
- // Comparator to work with base::STLSetDifference.
- bool operator>(const PermissionMessage& that) const {
- return id_ > that.id_;
- }
-
- private:
- ID id_;
- base::string16 message_;
- base::string16 details_;
-};
-
-typedef std::vector<PermissionMessage> PermissionMessages;
-
-} // namespace extensions
-
-#endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_H_
« no previous file with comments | « extensions/common/permissions/media_galleries_permission.cc ('k') | extensions/common/permissions/permission_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698