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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_api_pairing_delegate.cc

Issue 1902873002: Convert //extensions/browser/api from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "extensions/browser/api/bluetooth/bluetooth_api_pairing_delegate.h" 5 #include "extensions/browser/api/bluetooth/bluetooth_api_pairing_delegate.h"
6 6
7 #include <memory>
7 #include <utility> 8 #include <utility>
8 9
9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "content/public/browser/browser_context.h" 11 #include "content/public/browser/browser_context.h"
12 #include "device/bluetooth/bluetooth_device.h" 12 #include "device/bluetooth/bluetooth_device.h"
13 #include "extensions/browser/api/bluetooth/bluetooth_api_utils.h" 13 #include "extensions/browser/api/bluetooth/bluetooth_api_utils.h"
14 #include "extensions/browser/event_router.h" 14 #include "extensions/browser/event_router.h"
15 #include "extensions/browser/extension_system.h" 15 #include "extensions/browser/extension_system.h"
16 #include "extensions/common/api/bluetooth_private.h" 16 #include "extensions/common/api/bluetooth_private.h"
17 17
18 namespace extensions { 18 namespace extensions {
19 19
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void BluetoothApiPairingDelegate::AuthorizePairing( 94 void BluetoothApiPairingDelegate::AuthorizePairing(
95 device::BluetoothDevice* device) { 95 device::BluetoothDevice* device) {
96 bt_private::PairingEvent event; 96 bt_private::PairingEvent event;
97 PopulatePairingEvent( 97 PopulatePairingEvent(
98 device, bt_private::PAIRING_EVENT_TYPE_REQUESTAUTHORIZATION, &event); 98 device, bt_private::PAIRING_EVENT_TYPE_REQUESTAUTHORIZATION, &event);
99 DispatchPairingEvent(event); 99 DispatchPairingEvent(event);
100 } 100 }
101 101
102 void BluetoothApiPairingDelegate::DispatchPairingEvent( 102 void BluetoothApiPairingDelegate::DispatchPairingEvent(
103 const bt_private::PairingEvent& pairing_event) { 103 const bt_private::PairingEvent& pairing_event) {
104 scoped_ptr<base::ListValue> args = 104 std::unique_ptr<base::ListValue> args =
105 bt_private::OnPairing::Create(pairing_event); 105 bt_private::OnPairing::Create(pairing_event);
106 scoped_ptr<Event> event(new Event(events::BLUETOOTH_PRIVATE_ON_PAIRING, 106 std::unique_ptr<Event> event(new Event(events::BLUETOOTH_PRIVATE_ON_PAIRING,
107 bt_private::OnPairing::kEventName, 107 bt_private::OnPairing::kEventName,
108 std::move(args))); 108 std::move(args)));
109 EventRouter::Get(browser_context_)->BroadcastEvent(std::move(event)); 109 EventRouter::Get(browser_context_)->BroadcastEvent(std::move(event));
110 } 110 }
111 111
112 } // namespace extensions 112 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/bluetooth/bluetooth_api.cc ('k') | extensions/browser/api/bluetooth/bluetooth_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698