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_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class SocketsManifestPermission : public ManifestPermission { | 25 class SocketsManifestPermission : public ManifestPermission { |
26 public: | 26 public: |
27 typedef std::set<SocketPermissionEntry> SocketPermissionEntrySet; | 27 typedef std::set<SocketPermissionEntry> SocketPermissionEntrySet; |
28 SocketsManifestPermission(); | 28 SocketsManifestPermission(); |
29 virtual ~SocketsManifestPermission(); | 29 virtual ~SocketsManifestPermission(); |
30 | 30 |
31 // Tries to construct the info based on |value|, as it would have appeared in | 31 // Tries to construct the info based on |value|, as it would have appeared in |
32 // the manifest. Sets |error| and returns an empty scoped_ptr on failure. | 32 // the manifest. Sets |error| and returns an empty scoped_ptr on failure. |
33 static scoped_ptr<SocketsManifestPermission> FromValue( | 33 static scoped_ptr<SocketsManifestPermission> FromValue( |
34 const base::Value& value, | 34 const base::Value& value, |
35 string16* error); | 35 base::string16* error); |
36 | 36 |
37 bool CheckRequest(const Extension* extension, | 37 bool CheckRequest(const Extension* extension, |
38 const content::SocketPermissionRequest& request) const; | 38 const content::SocketPermissionRequest& request) const; |
39 | 39 |
40 void AddPermission(const SocketPermissionEntry& entry); | 40 void AddPermission(const SocketPermissionEntry& entry); |
41 | 41 |
42 // extensions::ManifestPermission overrides. | 42 // extensions::ManifestPermission overrides. |
43 virtual std::string name() const OVERRIDE; | 43 virtual std::string name() const OVERRIDE; |
44 virtual std::string id() const OVERRIDE; | 44 virtual std::string id() const OVERRIDE; |
45 virtual bool HasMessages() const OVERRIDE; | 45 virtual bool HasMessages() const OVERRIDE; |
(...skipping 20 matching lines...) Expand all Loading... |
66 void AddSubdomainHostMessage(PermissionMessages& messages) const; | 66 void AddSubdomainHostMessage(PermissionMessages& messages) const; |
67 void AddSpecificHostMessage(PermissionMessages& messages) const; | 67 void AddSpecificHostMessage(PermissionMessages& messages) const; |
68 void AddNetworkListMessage(PermissionMessages& messages) const; | 68 void AddNetworkListMessage(PermissionMessages& messages) const; |
69 | 69 |
70 SocketPermissionEntrySet permissions_; | 70 SocketPermissionEntrySet permissions_; |
71 }; | 71 }; |
72 | 72 |
73 } // namespace extensions | 73 } // namespace extensions |
74 | 74 |
75 #endif // CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_ | 75 #endif // CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_ |
OLD | NEW |