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

Unified Diff: chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.h

Issue 145663004: Replace "bluetooth" permission with manifest property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused function. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.h
diff --git a/chrome/common/extensions/api/sockets/sockets_manifest_permission.h b/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.h
similarity index 57%
copy from chrome/common/extensions/api/sockets/sockets_manifest_permission.h
copy to chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.h
index 92112c05d7c567feafd6fc98079a55a51376535d..8654e59cfd1fe8b78d9adf4a69b917a6db8eaed2 100644
--- a/chrome/common/extensions/api/sockets/sockets_manifest_permission.h
+++ b/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.h
@@ -2,42 +2,41 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_
-#define CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_
+#ifndef CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_
+#define CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_
#include <set>
#include <vector>
-#include "chrome/common/extensions/permissions/socket_permission_entry.h"
#include "extensions/common/install_warning.h"
#include "extensions/common/permissions/manifest_permission.h"
-namespace content {
-struct SocketPermissionRequest;
+namespace extensions {
+class Extension;
}
namespace extensions {
-class Extension;
+struct BluetoothPermissionRequest;
}
namespace extensions {
-class SocketsManifestPermission : public ManifestPermission {
+class BluetoothManifestPermission : public ManifestPermission {
public:
- typedef std::set<SocketPermissionEntry> SocketPermissionEntrySet;
- SocketsManifestPermission();
- virtual ~SocketsManifestPermission();
+ typedef std::set<std::string> BluetoothProfileUuidSet;
+ BluetoothManifestPermission();
+ virtual ~BluetoothManifestPermission();
// Tries to construct the info based on |value|, as it would have appeared in
// the manifest. Sets |error| and returns an empty scoped_ptr on failure.
- static scoped_ptr<SocketsManifestPermission> FromValue(
+ static scoped_ptr<BluetoothManifestPermission> FromValue(
const base::Value& value,
base::string16* error);
bool CheckRequest(const Extension* extension,
- const content::SocketPermissionRequest& request) const;
+ const BluetoothPermissionRequest& request) const;
- void AddPermission(const SocketPermissionEntry& entry);
+ void AddPermission(const std::string& profile_uuid);
// extensions::ManifestPermission overrides.
virtual std::string name() const OVERRIDE;
@@ -47,29 +46,26 @@ class SocketsManifestPermission : public ManifestPermission {
virtual bool FromValue(const base::Value* value) OVERRIDE;
virtual scoped_ptr<base::Value> ToValue() const OVERRIDE;
virtual ManifestPermission* Clone() const OVERRIDE;
- virtual ManifestPermission* Diff(const ManifestPermission* rhs) const
- OVERRIDE;
- virtual ManifestPermission* Union(const ManifestPermission* rhs) const
- OVERRIDE;
- virtual ManifestPermission* Intersect(const ManifestPermission* rhs) const
- OVERRIDE;
+ virtual ManifestPermission* Diff(const ManifestPermission* rhs)
+ const OVERRIDE;
+ virtual ManifestPermission* Union(const ManifestPermission* rhs)
+ const OVERRIDE;
+ virtual ManifestPermission* Intersect(const ManifestPermission* rhs)
+ const OVERRIDE;
virtual bool Contains(const ManifestPermission* rhs) const OVERRIDE;
virtual bool Equal(const ManifestPermission* rhs) const OVERRIDE;
virtual void Write(IPC::Message* m) const OVERRIDE;
virtual bool Read(const IPC::Message* m, PickleIterator* iter) OVERRIDE;
virtual void Log(std::string* log) const OVERRIDE;
- const SocketPermissionEntrySet& entries() const { return permissions_; }
+ const BluetoothProfileUuidSet& profile_uuids() const {
+ return profile_uuids_;
+ }
private:
- bool AddAnyHostMessage(PermissionMessages& messages) const;
- void AddSubdomainHostMessage(PermissionMessages& messages) const;
- void AddSpecificHostMessage(PermissionMessages& messages) const;
- void AddNetworkListMessage(PermissionMessages& messages) const;
-
- SocketPermissionEntrySet permissions_;
+ BluetoothProfileUuidSet profile_uuids_;
};
} // namespace extensions
-#endif // CHROME_COMMON_EXTENSIONS_API_SOCKETS_SOCKETS_MANIFEST_PERMISSION_H_
+#endif // CHROME_COMMON_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_

Powered by Google App Engine
This is Rietveld 408576698