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

Side by Side Diff: chrome/browser/ui/android/usb_chooser_dialog_android.cc

Issue 2821723002: Move classes in the device.usb Mojo namespace to device.mojom (Closed)
Patch Set: mcasas@ nits Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/ui/android/usb_chooser_dialog_android.h" 5 #include "chrome/browser/ui/android/usb_chooser_dialog_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "jni/UsbChooserDialog_jni.h" 31 #include "jni/UsbChooserDialog_jni.h"
32 #include "ui/android/window_android.h" 32 #include "ui/android/window_android.h"
33 #include "url/gurl.h" 33 #include "url/gurl.h"
34 34
35 using device::UsbDevice; 35 using device::UsbDevice;
36 36
37 namespace { 37 namespace {
38 38
39 void OnDevicePermissionRequestComplete( 39 void OnDevicePermissionRequestComplete(
40 scoped_refptr<UsbDevice> device, 40 scoped_refptr<UsbDevice> device,
41 const device::usb::ChooserService::GetPermissionCallback& callback, 41 const device::mojom::UsbChooserService::GetPermissionCallback& callback,
42 bool granted) { 42 bool granted) {
43 device::usb::DeviceInfoPtr device_info; 43 device::mojom::UsbDeviceInfoPtr device_info;
44 if (granted) 44 if (granted)
45 device_info = device::usb::DeviceInfo::From(*device); 45 device_info = device::mojom::UsbDeviceInfo::From(*device);
46 callback.Run(std::move(device_info)); 46 callback.Run(std::move(device_info));
47 } 47 }
48 48
49 } // namespace 49 } // namespace
50 50
51 UsbChooserDialogAndroid::UsbChooserDialogAndroid( 51 UsbChooserDialogAndroid::UsbChooserDialogAndroid(
52 const std::vector<device::UsbDeviceFilter>& filters, 52 const std::vector<device::UsbDeviceFilter>& filters,
53 content::RenderFrameHost* render_frame_host, 53 content::RenderFrameHost* render_frame_host,
54 const device::usb::ChooserService::GetPermissionCallback& callback) 54 const device::mojom::UsbChooserService::GetPermissionCallback& callback)
55 : render_frame_host_(render_frame_host), 55 : render_frame_host_(render_frame_host),
56 callback_(callback), 56 callback_(callback),
57 usb_service_observer_(this), 57 usb_service_observer_(this),
58 filters_(filters), 58 filters_(filters),
59 weak_factory_(this) { 59 weak_factory_(this) {
60 device::UsbService* usb_service = 60 device::UsbService* usb_service =
61 device::DeviceClient::Get()->GetUsbService(); 61 device::DeviceClient::Get()->GetUsbService();
62 if (!usb_service) 62 if (!usb_service)
63 return; 63 return;
64 64
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 return device::FindInWebUsbAllowedOrigins( 237 return device::FindInWebUsbAllowedOrigins(
238 device->webusb_allowed_origins(), 238 device->webusb_allowed_origins(),
239 render_frame_host_->GetLastCommittedURL().GetOrigin(), base::nullopt, 239 render_frame_host_->GetLastCommittedURL().GetOrigin(), base::nullopt,
240 base::nullopt); 240 base::nullopt);
241 } 241 }
242 242
243 // static 243 // static
244 bool UsbChooserDialogAndroid::Register(JNIEnv* env) { 244 bool UsbChooserDialogAndroid::Register(JNIEnv* env) {
245 return RegisterNativesImpl(env); 245 return RegisterNativesImpl(env);
246 } 246 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/usb_chooser_dialog_android.h ('k') | chrome/browser/usb/usb_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698