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

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

Issue 1906183002: WebUSB Android chooser should be closed when "Get help" button is pressed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address yfriedman@'s comment Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 void UsbChooserDialogAndroid::OnDialogCancelled( 159 void UsbChooserDialogAndroid::OnDialogCancelled(
160 JNIEnv* env, 160 JNIEnv* env,
161 const base::android::JavaParamRef<jobject>& obj) { 161 const base::android::JavaParamRef<jobject>& obj) {
162 Cancel(); 162 Cancel();
163 } 163 }
164 164
165 void UsbChooserDialogAndroid::LoadUsbHelpPage( 165 void UsbChooserDialogAndroid::LoadUsbHelpPage(
166 JNIEnv* env, 166 JNIEnv* env,
167 const base::android::JavaParamRef<jobject>& obj) { 167 const base::android::JavaParamRef<jobject>& obj) {
168 OpenUrl(chrome::kChooserUsbOverviewURL); 168 OpenUrl(chrome::kChooserUsbOverviewURL);
169 Cancel();
169 } 170 }
170 171
171 // Get a list of devices that can be shown in the chooser bubble UI for 172 // Get a list of devices that can be shown in the chooser bubble UI for
172 // user to grant permsssion. 173 // user to grant permsssion.
173 void UsbChooserDialogAndroid::GotUsbDeviceList( 174 void UsbChooserDialogAndroid::GotUsbDeviceList(
174 const std::vector<scoped_refptr<device::UsbDevice>>& devices) { 175 const std::vector<scoped_refptr<device::UsbDevice>>& devices) {
175 for (const auto& device : devices) { 176 for (const auto& device : devices) {
176 if (device::UsbDeviceFilter::MatchesAny(device, filters_) && 177 if (device::UsbDeviceFilter::MatchesAny(device, filters_) &&
177 FindInWebUsbAllowedOrigins( 178 FindInWebUsbAllowedOrigins(
178 device->webusb_allowed_origins(), 179 device->webusb_allowed_origins(),
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 ->OpenURL(content::OpenURLParams(GURL(url), content::Referrer(), 214 ->OpenURL(content::OpenURLParams(GURL(url), content::Referrer(),
214 NEW_FOREGROUND_TAB, 215 NEW_FOREGROUND_TAB,
215 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 216 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
216 false)); // is_renderer_initiated 217 false)); // is_renderer_initiated
217 } 218 }
218 219
219 // static 220 // static
220 bool UsbChooserDialogAndroid::Register(JNIEnv* env) { 221 bool UsbChooserDialogAndroid::Register(JNIEnv* env) {
221 return RegisterNativesImpl(env); 222 return RegisterNativesImpl(env);
222 } 223 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698