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

Side by Side Diff: chrome/common/extensions/api/bluetooth/bluetooth_manifest_handler.cc

Issue 145663004: Replace "bluetooth" permission with manifest property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2013 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 #include "chrome/common/extensions/api/bluetooth/bluetooth_manifest_handler.h"
6
7 #include "chrome/common/extensions/api/bluetooth/bluetooth_manifest_data.h"
8 #include "chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.h "
9 #include "extensions/common/extension.h"
10 #include "extensions/common/manifest_constants.h"
11
12 namespace extensions {
13
14 BluetoothManifestHandler::BluetoothManifestHandler() {}
15
16 BluetoothManifestHandler::~BluetoothManifestHandler() {}
17
18 bool BluetoothManifestHandler::Parse(Extension* extension,
19 base::string16* error) {
not at google - send to devlin 2014/01/23 20:29:12 indent
rpaquay 2014/01/24 16:58:23 Done.
20 const base::Value* bluetooth = NULL;
21 CHECK(extension->manifest()->Get(manifest_keys::kBluetooth, &bluetooth));
22 scoped_ptr<BluetoothManifestData> data =
23 BluetoothManifestData::FromValue(*bluetooth, error);
24 if (!data)
25 return false;
26
27 extension->SetManifestData(manifest_keys::kBluetooth, data.release());
28 return true;
29 }
30
31 ManifestPermission* BluetoothManifestHandler::CreatePermission() {
32 return new BluetoothManifestPermission();
33 }
34
35 ManifestPermission* BluetoothManifestHandler::CreateInitialRequiredPermission(
36 const Extension* extension) {
37 BluetoothManifestData* data = BluetoothManifestData::Get(extension);
38 if (data)
39 return data->permission()->Clone();
40 return NULL;
41 }
42
43 const std::vector<std::string> BluetoothManifestHandler::Keys() const {
44 return SingleKey(manifest_keys::kBluetooth);
45 }
46
47 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698