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

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

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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 "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"
11 #include "extensions/browser/api/bluetooth/bluetooth_api_utils.h" 11 #include "extensions/browser/api/bluetooth/bluetooth_api_utils.h"
12 #include "extensions/browser/event_router.h" 12 #include "extensions/browser/event_router.h"
13 #include "extensions/browser/extension_system.h" 13 #include "extensions/browser/extension_system.h"
14 #include "extensions/common/api/bluetooth_private.h" 14 #include "extensions/common/api/bluetooth_private.h"
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 namespace bt_private = core_api::bluetooth_private; 18 namespace bt_private = api::bluetooth_private;
19 19
20 namespace { 20 namespace {
21 21
22 void PopulatePairingEvent(const device::BluetoothDevice* device, 22 void PopulatePairingEvent(const device::BluetoothDevice* device,
23 bt_private::PairingEventType type, 23 bt_private::PairingEventType type,
24 bt_private::PairingEvent* out) { 24 bt_private::PairingEvent* out) {
25 core_api::bluetooth::BluetoothDeviceToApiDevice(*device, &out->device); 25 api::bluetooth::BluetoothDeviceToApiDevice(*device, &out->device);
26 out->pairing = type; 26 out->pairing = type;
27 } 27 }
28 28
29 } // namespace 29 } // namespace
30 30
31 BluetoothApiPairingDelegate::BluetoothApiPairingDelegate( 31 BluetoothApiPairingDelegate::BluetoothApiPairingDelegate(
32 const std::string& extension_id, 32 const std::string& extension_id,
33 content::BrowserContext* browser_context) 33 content::BrowserContext* browser_context)
34 : extension_id_(extension_id), browser_context_(browser_context) {} 34 : extension_id_(extension_id), browser_context_(browser_context) {}
35 35
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(new Event(events::BLUETOOTH_PRIVATE_ON_PAIRING, 105 scoped_ptr<Event> event(new Event(events::BLUETOOTH_PRIVATE_ON_PAIRING,
106 bt_private::OnPairing::kEventName, 106 bt_private::OnPairing::kEventName,
107 args.Pass())); 107 args.Pass()));
108 EventRouter::Get(browser_context_) 108 EventRouter::Get(browser_context_)
109 ->DispatchEventToExtension(extension_id_, event.Pass()); 109 ->DispatchEventToExtension(extension_id_, event.Pass());
110 } 110 }
111 111
112 } // namespace extensions 112 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698