| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_COALESCED_PERMISSION_MESSAGE_H_ | 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_COALESCED_PERMISSION_MESSAGE_H_ |
| 6 #define EXTENSIONS_COMMON_PERMISSIONS_COALESCED_PERMISSION_MESSAGE_H_ | 6 #define EXTENSIONS_COMMON_PERMISSIONS_COALESCED_PERMISSION_MESSAGE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_vector.h" | |
| 12 #include "extensions/common/permissions/api_permission.h" | |
| 13 #include "extensions/common/permissions/api_permission_set.h" | 11 #include "extensions/common/permissions/api_permission_set.h" |
| 14 | 12 |
| 15 namespace extensions { | 13 namespace extensions { |
| 16 | 14 |
| 17 // The new kind of Chrome app/extension permission messages. | 15 // The new kind of Chrome app/extension permission messages. |
| 18 // | 16 // |
| 19 // A CoalescedPermissionMessage is an immutable object that represents a single | 17 // A CoalescedPermissionMessage is an immutable object that represents a single |
| 20 // bullet in the list of an app or extension's permissions. It contains the | 18 // bullet in the list of an app or extension's permissions. It contains the |
| 21 // localized permission message to display, as well as the set of permissions | 19 // localized permission message to display, as well as the set of permissions |
| 22 // that contributed to that message (and should be revoked if this permission is | 20 // that contributed to that message (and should be revoked if this permission is |
| (...skipping 29 matching lines...) Expand all Loading... |
| 52 const base::string16& message() const { return message_; } | 50 const base::string16& message() const { return message_; } |
| 53 const PermissionIDSet& permissions() const { return permissions_; } | 51 const PermissionIDSet& permissions() const { return permissions_; } |
| 54 const std::vector<base::string16>& submessages() const { | 52 const std::vector<base::string16>& submessages() const { |
| 55 return submessages_; | 53 return submessages_; |
| 56 } | 54 } |
| 57 | 55 |
| 58 private: | 56 private: |
| 59 const base::string16 message_; | 57 const base::string16 message_; |
| 60 const PermissionIDSet permissions_; | 58 const PermissionIDSet permissions_; |
| 61 const std::vector<base::string16> submessages_; | 59 const std::vector<base::string16> submessages_; |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(CoalescedPermissionMessage); | |
| 64 }; | 60 }; |
| 65 | 61 |
| 66 typedef std::vector<CoalescedPermissionMessage> CoalescedPermissionMessages; | 62 // Use a linked list to store our list of messages, since we will commonly be |
| 63 // iterating/removing elements but should never be accessing by index. |
| 64 typedef std::list<CoalescedPermissionMessage> CoalescedPermissionMessages; |
| 67 | 65 |
| 68 } // namespace extensions | 66 } // namespace extensions |
| 69 | 67 |
| 70 #endif // EXTENSIONS_COMMON_PERMISSIONS_COALESCED_PERMISSION_MESSAGE_H_ | 68 #endif // EXTENSIONS_COMMON_PERMISSIONS_COALESCED_PERMISSION_MESSAGE_H_ |
| OLD | NEW |