Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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/usb/usb_chooser_bubble_delegate.h" | |
| 6 | |
| 7 #if defined(OS_MACOSX) | |
| 8 #include "components/bubble/bubble_ui.h" | |
| 9 #else | |
| 10 #include "chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.h" | |
| 11 #endif | |
| 12 #include "chrome/browser/usb/usb_chooser_options.h" | |
| 13 | |
| 14 UsbChooserBubbleDelegate::UsbChooserBubbleDelegate( | |
| 15 Browser* browser, | |
| 16 mojo::Array<device::usb::DeviceFilterPtr> device_filters, | |
| 17 content::RenderFrameHost* render_frame_host, | |
| 18 const webusb::WebUsbPermissionBubble::GetPermissionCallback& callback) | |
| 19 : browser_(browser) { | |
| 20 DCHECK(browser_); | |
| 21 chooser_options_.reset(new UsbChooserOptions(device_filters.Pass(), | |
| 22 render_frame_host, callback)); | |
| 23 } | |
| 24 | |
| 25 UsbChooserBubbleDelegate::~UsbChooserBubbleDelegate() {} | |
| 26 | |
| 27 scoped_ptr<BubbleUi> UsbChooserBubbleDelegate::BuildBubbleUi() { | |
| 28 scoped_ptr<BubbleUi> bubble_ui; | |
|
felt
2015/12/03 01:19:19
this seems like an odd pattern. why is this being
felt
2015/12/03 01:21:17
i now realize the answer is yes, a separate CL. ca
juncai
2015/12/03 18:33:59
Done.
juncai
2015/12/03 18:33:59
Yes, it is a separate CL which depends on this CL.
| |
| 29 #if !defined(OS_MACOSX) | |
| 30 bubble_ui.reset( | |
| 31 new ChooserBubbleUiView(browser_, chooser_options_.get(), this)); | |
| 32 #endif | |
| 33 return bubble_ui.Pass(); | |
| 34 } | |
| 35 | |
| 36 void UsbChooserBubbleDelegate::Select(int index) { | |
| 37 chooser_options_->Select(index); | |
| 38 } | |
| 39 | |
| 40 void UsbChooserBubbleDelegate::Cancel() {} | |
| OLD | NEW |