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

Side by Side Diff: chrome/common/extensions/permissions/socket_permission.h

Issue 201203006: Move basic API permissions code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move moar things Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_SOCKET_PERMISSION_H_
6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_SOCKET_PERMISSION_H_
7
8 #include <string>
9
10 #include "chrome/common/extensions/permissions/set_disjunction_permission.h"
11 #include "chrome/common/extensions/permissions/socket_permission_data.h"
12 #include "extensions/common/permissions/api_permission.h"
13
14 namespace extensions {
15
16 class SocketPermission : public SetDisjunctionPermission<SocketPermissionData,
17 SocketPermission> {
18 public:
19 struct CheckParam : APIPermission::CheckParam {
20 CheckParam(content::SocketPermissionRequest::OperationType type,
21 const std::string& host,
22 int port)
23 : request(type, host, port) { }
24 content::SocketPermissionRequest request;
25 };
26
27 explicit SocketPermission(const APIPermissionInfo* info);
28
29 virtual ~SocketPermission();
30
31 // Returns the localized permission messages of this permission.
32 virtual PermissionMessages GetMessages() const OVERRIDE;
33
34 private:
35 bool AddAnyHostMessage(PermissionMessages& messages) const;
36 void AddSubdomainHostMessage(PermissionMessages& messages) const;
37 void AddSpecificHostMessage(PermissionMessages& messages) const;
38 void AddNetworkListMessage(PermissionMessages& messages) const;
39 };
40
41 } // namespace extensions
42
43 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_SOCKET_PERMISSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698