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

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

Issue 11413099: Bluetooth API Permission Dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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_BLUETOOTH_DEVICE_PERMISSION_H_
6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_BLUETOOTH_DEVICE_PERMISSION_H_
7
8 #include <set>
9 #include <string>
10
11 #include "chrome/common/extensions/permissions/api_permission.h"
12
13 namespace base {
14 class Value;
15 }
16
17 namespace IPC {
18 class Message;
19 }
20
21 namespace extensions {
22
23 // There's room to share code with related classes, see http://crbug.com/147531
24 class BluetoothDevicePermission : public APIPermission {
25 public:
26 struct CheckParam : APIPermission::CheckParam {
Matt Perry 2012/11/27 21:35:32 does this need to use public inheritance?
bryeung 2012/11/28 21:55:05 Yes: we do casts from APIPermission::CheckParam to
27 CheckParam(const std::string& device_address)
28 : device_address(device_address) {}
29 const std::string device_address;
30 };
31
32 explicit BluetoothDevicePermission(const APIPermissionInfo* info);
33
34 virtual ~BluetoothDevicePermission();
35
36 // Adds BluetoothDevices from |devices| to the set of allowed devices.
37 // |devices| should be a string of Bluetooth device addresses separated by |.
38 void AddDevicesFromString(const std::string &devices_string);
Matt Perry 2012/11/27 21:35:32 nit: & before space
bryeung 2012/11/28 21:55:05 Done.
39
40 // APIPermission overrides
41 virtual std::string ToString() const OVERRIDE;
42 virtual bool ManifestEntryRequired() const OVERRIDE;
43 virtual bool ManifestEntryForbidden() const OVERRIDE;
44 virtual bool HasMessages() const OVERRIDE;
45 virtual PermissionMessages GetMessages() const OVERRIDE;
46 virtual bool Check(
47 const APIPermission::CheckParam* param) const OVERRIDE;
48 virtual bool Contains(const APIPermission* rhs) const OVERRIDE;
49 virtual bool Equal(const APIPermission* rhs) const OVERRIDE;
50 virtual bool FromValue(const base::Value* value) OVERRIDE;
51 virtual void ToValue(base::Value** value) const OVERRIDE;
52 virtual APIPermission* Clone() const OVERRIDE;
53 virtual APIPermission* Diff(const APIPermission* rhs) const OVERRIDE;
54 virtual APIPermission* Union(const APIPermission* rhs) const OVERRIDE;
55 virtual APIPermission* Intersect(const APIPermission* rhs) const OVERRIDE;
56 virtual void Write(IPC::Message* m) const OVERRIDE;
57 virtual bool Read(const IPC::Message* m, PickleIterator* iter) OVERRIDE;
58 virtual void Log(std::string* log) const OVERRIDE;
59
60 private:
61 std::set<std::string> allowed_devices_;
Matt Perry 2012/11/27 21:35:32 shouldn't this be requested_devices instead?
bryeung 2012/11/28 21:55:05 Depends. If it's a request, then yes. But if thi
Matt Perry 2012/11/28 21:59:00 Sounds good. (though it seems the latest upload d
62 };
63
64 } // namespace extensions
65
66 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_BLUETOOTH_DEVICE_PERMISSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698