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

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

Issue 1908953003: Convert //extensions/{common,shell} from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 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
« no previous file with comments | « no previous file | extensions/common/api/bluetooth/bluetooth_manifest_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_ 5 #ifndef EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_
6 #define EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_ 6 #define EXTENSIONS_COMMON_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"
11 #include "extensions/common/extension.h" 11 #include "extensions/common/extension.h"
12 #include "extensions/common/manifest_handler.h" 12 #include "extensions/common/manifest_handler.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 class BluetoothManifestPermission; 15 class BluetoothManifestPermission;
16 struct BluetoothPermissionRequest; 16 struct BluetoothPermissionRequest;
17 } 17 }
18 18
19 namespace extensions { 19 namespace extensions {
20 20
21 // The parsed form of the "bluetooth" manifest entry. 21 // The parsed form of the "bluetooth" manifest entry.
22 class BluetoothManifestData : public Extension::ManifestData { 22 class BluetoothManifestData : public Extension::ManifestData {
23 public: 23 public:
24 explicit BluetoothManifestData( 24 explicit BluetoothManifestData(
25 scoped_ptr<BluetoothManifestPermission> permission); 25 std::unique_ptr<BluetoothManifestPermission> permission);
26 ~BluetoothManifestData() override; 26 ~BluetoothManifestData() override;
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); 35 static bool CheckSocketPermitted(const Extension* extension);
36 static bool CheckLowEnergyPermitted(const Extension* extension); 36 static bool CheckLowEnergyPermitted(const Extension* extension);
37 static bool CheckPeripheralPermitted(const Extension* extension); 37 static bool CheckPeripheralPermitted(const Extension* extension);
38 38
39 // Tries to construct the info based on |value|, as it would have appeared in 39 // Tries to construct the info based on |value|, as it would have appeared in
40 // the manifest. Sets |error| and returns an empty scoped_ptr on failure. 40 // the manifest. Sets |error| and returns an empty scoped_ptr on failure.
41 static scoped_ptr<BluetoothManifestData> FromValue(const base::Value& value, 41 static std::unique_ptr<BluetoothManifestData> FromValue(
42 base::string16* error); 42 const base::Value& value,
43 base::string16* error);
43 44
44 const BluetoothManifestPermission* permission() const { 45 const BluetoothManifestPermission* permission() const {
45 return permission_.get(); 46 return permission_.get();
46 } 47 }
47 48
48 private: 49 private:
49 scoped_ptr<BluetoothManifestPermission> permission_; 50 std::unique_ptr<BluetoothManifestPermission> permission_;
50 }; 51 };
51 52
52 // Used for checking bluetooth permission. 53 // Used for checking bluetooth permission.
53 struct BluetoothPermissionRequest { 54 struct BluetoothPermissionRequest {
54 explicit BluetoothPermissionRequest(const std::string& uuid); 55 explicit BluetoothPermissionRequest(const std::string& uuid);
55 ~BluetoothPermissionRequest(); 56 ~BluetoothPermissionRequest();
56 57
57 std::string uuid; 58 std::string uuid;
58 }; 59 };
59 60
60 } // namespace extensions 61 } // namespace extensions
61 62
62 #endif // EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_ 63 #endif // EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/common/api/bluetooth/bluetooth_manifest_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698