| OLD | NEW |
| 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 #include "device/bluetooth/bluetooth_device.h" | 10 #include "device/bluetooth/bluetooth_device.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 bt_private::PairingEvent event; | 95 bt_private::PairingEvent event; |
| 96 PopulatePairingEvent( | 96 PopulatePairingEvent( |
| 97 device, bt_private::PAIRING_EVENT_TYPE_REQUESTAUTHORIZATION, &event); | 97 device, bt_private::PAIRING_EVENT_TYPE_REQUESTAUTHORIZATION, &event); |
| 98 DispatchPairingEvent(event); | 98 DispatchPairingEvent(event); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void BluetoothApiPairingDelegate::DispatchPairingEvent( | 101 void BluetoothApiPairingDelegate::DispatchPairingEvent( |
| 102 const bt_private::PairingEvent& pairing_event) { | 102 const bt_private::PairingEvent& pairing_event) { |
| 103 scoped_ptr<base::ListValue> args = | 103 scoped_ptr<base::ListValue> args = |
| 104 bt_private::OnPairing::Create(pairing_event); | 104 bt_private::OnPairing::Create(pairing_event); |
| 105 scoped_ptr<Event> event( | 105 scoped_ptr<Event> event(new Event( |
| 106 new Event(bt_private::OnPairing::kEventName, args.Pass())); | 106 events::UNKNOWN, bt_private::OnPairing::kEventName, args.Pass())); |
| 107 EventRouter::Get(browser_context_) | 107 EventRouter::Get(browser_context_) |
| 108 ->DispatchEventToExtension(extension_id_, event.Pass()); | 108 ->DispatchEventToExtension(extension_id_, event.Pass()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace extensions | 111 } // namespace extensions |
| OLD | NEW |