Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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/browser/chromeos/bluetooth/bluetooth_pairing_view.h" | |
| 6 | |
| 7 #include "chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h" | |
| 8 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" | |
| 9 #include "ui/views/widget/widget.h" | |
| 10 #include "ui/web_dialogs/web_dialog_delegate.h" | |
| 11 | |
| 12 namespace chromeos { | |
| 13 | |
| 14 BluetoothPairingView::BluetoothPairingView(content::BrowserContext* context, | |
| 15 ui::WebDialogDelegate* delegate, | |
| 16 WebContentsHandler* handler) | |
| 17 : views::WebDialogView(context, delegate, handler) {} | |
| 18 | |
| 19 BluetoothPairingView::~BluetoothPairingView() {} | |
| 20 | |
| 21 // static | |
| 22 void BluetoothPairingView::ShowDialog(int container_id, | |
| 23 content::BrowserContext* context, | |
| 24 WebContentsHandler* handler, | |
| 25 const device::BluetoothDevice* device) { | |
| 26 BluetoothPairingDialog* dialog = new BluetoothPairingDialog(device); | |
|
James Cook
2017/02/09 15:18:02
nit: document ownership (since you're using raw ne
| |
| 27 BluetoothPairingView* view = | |
| 28 new BluetoothPairingView(context, dialog, handler); | |
| 29 dialog->ShowInContainer(container_id, view); | |
| 30 } | |
| 31 | |
| 32 } // namespace chromeos | |
| OLD | NEW |