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

Side by Side Diff: chrome/common/extensions/api/bluetooth/bluetooth_manifest_data.h

Issue 325893002: Bluetooth: add socket & low_energy manifest check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add permission denied tests Created 6 years, 6 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_
6 #define CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_ 6 #define CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 14 matching lines...) Expand all
25 scoped_ptr<BluetoothManifestPermission> permission); 25 scoped_ptr<BluetoothManifestPermission> permission);
26 virtual ~BluetoothManifestData(); 26 virtual ~BluetoothManifestData();
27 27
28 // Gets the BluetoothManifestData for |extension|, or NULL if none was 28 // Gets the BluetoothManifestData for |extension|, or NULL if none was
29 // specified. 29 // specified.
30 static BluetoothManifestData* Get(const Extension* extension); 30 static BluetoothManifestData* Get(const Extension* extension);
31 31
32 static bool CheckRequest(const Extension* extension, 32 static bool CheckRequest(const Extension* extension,
33 const BluetoothPermissionRequest& request); 33 const BluetoothPermissionRequest& request);
34 34
35 static bool CheckSocketPermitted(const Extension* extension);
36 static bool CheckLowEnergyPermitted(const Extension* extension);
37
35 // Tries to construct the info based on |value|, as it would have appeared in 38 // Tries to construct the info based on |value|, as it would have appeared in
36 // the manifest. Sets |error| and returns an empty scoped_ptr on failure. 39 // the manifest. Sets |error| and returns an empty scoped_ptr on failure.
37 static scoped_ptr<BluetoothManifestData> FromValue(const base::Value& value, 40 static scoped_ptr<BluetoothManifestData> FromValue(const base::Value& value,
38 base::string16* error); 41 base::string16* error);
39 42
40 const BluetoothManifestPermission* permission() const { 43 const BluetoothManifestPermission* permission() const {
41 return permission_.get(); 44 return permission_.get();
42 } 45 }
43 46
44 private: 47 private:
45 scoped_ptr<BluetoothManifestPermission> permission_; 48 scoped_ptr<BluetoothManifestPermission> permission_;
46 }; 49 };
47 50
48 // Used for checking bluetooth permission. 51 // Used for checking bluetooth permission.
49 struct BluetoothPermissionRequest { 52 struct BluetoothPermissionRequest {
50 explicit BluetoothPermissionRequest(const std::string& uuid); 53 explicit BluetoothPermissionRequest(const std::string& uuid);
51 ~BluetoothPermissionRequest(); 54 ~BluetoothPermissionRequest();
52 55
53 std::string uuid; 56 std::string uuid;
54 }; 57 };
55 58
56 } // namespace extensions 59 } // namespace extensions
57 60
58 #endif // CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_ 61 #endif // CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698