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 CHROME_COMMON_EXTENSIONS_PERMISSIONS_CHROME_PERMISSION_MESSAGE_PROVIDER_
H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_CHROME_PERMISSION_MESSAGE_PROVIDER_
H_ |
6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_CHROME_PERMISSION_MESSAGE_PROVIDER_
H_ | 6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_CHROME_PERMISSION_MESSAGE_PROVIDER_
H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "extensions/common/permissions/permission_message_provider.h" | 13 #include "extensions/common/permissions/permission_message_provider.h" |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 // Tested in two places: | 17 // Tested in two places: |
18 // 1. chrome_permission_message_provider_unittest.cc, which is a regular unit | 18 // 1. chrome_permission_message_provider_unittest.cc, which is a regular unit |
19 // test for this class | 19 // test for this class |
20 // 2. chrome/browser/extensions/permission_messages_unittest.cc, which is an | 20 // 2. chrome/browser/extensions/permission_messages_unittest.cc, which is an |
21 // integration test that ensures messages are correctly generated for | 21 // integration test that ensures messages are correctly generated for |
22 // extensions created through the extension system. | 22 // extensions created through the extension system. |
23 class ChromePermissionMessageProvider : public PermissionMessageProvider { | 23 class ChromePermissionMessageProvider : public PermissionMessageProvider { |
24 public: | 24 public: |
25 ChromePermissionMessageProvider(); | 25 ChromePermissionMessageProvider(); |
26 virtual ~ChromePermissionMessageProvider(); | 26 ~ChromePermissionMessageProvider() override; |
27 | 27 |
28 // PermissionMessageProvider implementation. | 28 // PermissionMessageProvider implementation. |
29 virtual PermissionMessages GetPermissionMessages( | 29 PermissionMessages GetPermissionMessages( |
30 const PermissionSet* permissions, | 30 const PermissionSet* permissions, |
31 Manifest::Type extension_type) const override; | 31 Manifest::Type extension_type) const override; |
32 virtual std::vector<base::string16> GetWarningMessages( | 32 std::vector<base::string16> GetWarningMessages( |
33 const PermissionSet* permissions, | 33 const PermissionSet* permissions, |
34 Manifest::Type extension_type) const override; | 34 Manifest::Type extension_type) const override; |
35 virtual std::vector<base::string16> GetWarningMessagesDetails( | 35 std::vector<base::string16> GetWarningMessagesDetails( |
36 const PermissionSet* permissions, | 36 const PermissionSet* permissions, |
37 Manifest::Type extension_type) const override; | 37 Manifest::Type extension_type) const override; |
38 virtual bool IsPrivilegeIncrease( | 38 bool IsPrivilegeIncrease(const PermissionSet* old_permissions, |
39 const PermissionSet* old_permissions, | 39 const PermissionSet* new_permissions, |
40 const PermissionSet* new_permissions, | 40 Manifest::Type extension_type) const override; |
41 Manifest::Type extension_type) const override; | |
42 | 41 |
43 private: | 42 private: |
44 // Gets the permission messages for the API permissions. | 43 // Gets the permission messages for the API permissions. |
45 std::set<PermissionMessage> GetAPIPermissionMessages( | 44 std::set<PermissionMessage> GetAPIPermissionMessages( |
46 const PermissionSet* permissions) const; | 45 const PermissionSet* permissions) const; |
47 | 46 |
48 // Gets the permission messages for the Manifest permissions. | 47 // Gets the permission messages for the Manifest permissions. |
49 std::set<PermissionMessage> GetManifestPermissionMessages( | 48 std::set<PermissionMessage> GetManifestPermissionMessages( |
50 const PermissionSet* permissions) const; | 49 const PermissionSet* permissions) const; |
51 | 50 |
(...skipping 20 matching lines...) Expand all Loading... |
72 const PermissionSet* old_permissions, | 71 const PermissionSet* old_permissions, |
73 const PermissionSet* new_permissions, | 72 const PermissionSet* new_permissions, |
74 Manifest::Type extension_type) const; | 73 Manifest::Type extension_type) const; |
75 | 74 |
76 DISALLOW_COPY_AND_ASSIGN(ChromePermissionMessageProvider); | 75 DISALLOW_COPY_AND_ASSIGN(ChromePermissionMessageProvider); |
77 }; | 76 }; |
78 | 77 |
79 } // namespace extensions | 78 } // namespace extensions |
80 | 79 |
81 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_CHROME_PERMISSION_MESSAGE_PROVID
ER_H_ | 80 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_CHROME_PERMISSION_MESSAGE_PROVID
ER_H_ |
OLD | NEW |