Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / common / extensions / api / bluetooth / bluetooth_manifest_permission.h
blobb4d997c2a20105b83ca5518cc8a8e660726feb07
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
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_
6 #define CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_
8 #include <set>
9 #include <vector>
11 #include "extensions/common/install_warning.h"
12 #include "extensions/common/permissions/manifest_permission.h"
14 namespace extensions {
15 class Extension;
18 namespace extensions {
19 struct BluetoothPermissionRequest;
22 namespace extensions {
24 class BluetoothManifestPermission : public ManifestPermission {
25 public:
26 typedef std::set<std::string> BluetoothUuidSet;
27 BluetoothManifestPermission();
28 virtual ~BluetoothManifestPermission();
30 // Tries to construct the info based on |value|, as it would have appeared in
31 // the manifest. Sets |error| and returns an empty scoped_ptr on failure.
32 static scoped_ptr<BluetoothManifestPermission> FromValue(
33 const base::Value& value,
34 base::string16* error);
36 bool CheckRequest(const Extension* extension,
37 const BluetoothPermissionRequest& request) const;
39 void AddPermission(const std::string& uuid);
41 // extensions::ManifestPermission overrides.
42 virtual std::string name() const OVERRIDE;
43 virtual std::string id() const OVERRIDE;
44 virtual bool HasMessages() const OVERRIDE;
45 virtual PermissionMessages GetMessages() const OVERRIDE;
46 virtual bool FromValue(const base::Value* value) OVERRIDE;
47 virtual scoped_ptr<base::Value> ToValue() const OVERRIDE;
48 virtual ManifestPermission* Clone() const OVERRIDE;
49 virtual ManifestPermission* Diff(const ManifestPermission* rhs)
50 const OVERRIDE;
51 virtual ManifestPermission* Union(const ManifestPermission* rhs)
52 const OVERRIDE;
53 virtual ManifestPermission* Intersect(const ManifestPermission* rhs)
54 const OVERRIDE;
55 virtual bool Contains(const ManifestPermission* rhs) const OVERRIDE;
56 virtual bool Equal(const ManifestPermission* rhs) const OVERRIDE;
57 virtual void Write(IPC::Message* m) const OVERRIDE;
58 virtual bool Read(const IPC::Message* m, PickleIterator* iter) OVERRIDE;
59 virtual void Log(std::string* log) const OVERRIDE;
61 const BluetoothUuidSet& uuids() const {
62 return uuids_;
65 private:
66 BluetoothUuidSet uuids_;
69 } // namespace extensions
71 #endif // CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_