OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/common/extensions/permissions/bluetooth_device_permission_data.
h" | 5 #include "chrome/common/extensions/permissions/bluetooth_device_permission_data.
h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/common/extensions/permissions/bluetooth_device_permission.h" | 11 #include "chrome/common/extensions/permissions/bluetooth_device_permission.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 const char* kDeviceAddressKey = "deviceAddress"; | 15 const char* kDeviceAddressKey = "deviceAddress"; |
16 | 16 |
17 } // namespace | 17 } // namespace |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 | 20 |
21 BluetoothDevicePermissionData::BluetoothDevicePermissionData() | 21 BluetoothDevicePermissionData::BluetoothDevicePermissionData() {} |
22 : device_address_("") { | |
23 } | |
24 | 22 |
25 BluetoothDevicePermissionData::BluetoothDevicePermissionData( | 23 BluetoothDevicePermissionData::BluetoothDevicePermissionData( |
26 const std::string& device_address) : device_address_(device_address) { | 24 const std::string& device_address) : device_address_(device_address) { |
27 } | 25 } |
28 | 26 |
29 bool BluetoothDevicePermissionData::Check( | 27 bool BluetoothDevicePermissionData::Check( |
30 const APIPermission::CheckParam* param) const { | 28 const APIPermission::CheckParam* param) const { |
31 if (!param) | 29 if (!param) |
32 return false; | 30 return false; |
33 const BluetoothDevicePermission::CheckParam& specific_param = | 31 const BluetoothDevicePermission::CheckParam& specific_param = |
(...skipping 27 matching lines...) Expand all Loading... |
61 const BluetoothDevicePermissionData& rhs) const { | 59 const BluetoothDevicePermissionData& rhs) const { |
62 return device_address_ < rhs.device_address_; | 60 return device_address_ < rhs.device_address_; |
63 } | 61 } |
64 | 62 |
65 bool BluetoothDevicePermissionData::operator==( | 63 bool BluetoothDevicePermissionData::operator==( |
66 const BluetoothDevicePermissionData& rhs) const { | 64 const BluetoothDevicePermissionData& rhs) const { |
67 return device_address_ == rhs.device_address_; | 65 return device_address_ == rhs.device_address_; |
68 } | 66 } |
69 | 67 |
70 } // namespace extensions | 68 } // namespace extensions |
OLD | NEW |