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

Side by Side Diff: chrome/browser/usb/usb_chooser_bubble_delegate.cc

Issue 1408193003: Add chrome side webusb permission UI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address felt@'s comments Created 5 years 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
(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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698