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

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

Issue 2126873003: Change WebBluetooth chooser title to "pair with" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@support_chrome_extension_chooser_title
Patch Set: address comments Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 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 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/usb/usb_chooser_controller.h" 5 #include "chrome/browser/usb/usb_chooser_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 28 matching lines...) Expand all
39 return browser_displayer.browser(); 39 return browser_displayer.browser();
40 } 40 }
41 41
42 } // namespace 42 } // namespace
43 43
44 UsbChooserController::UsbChooserController( 44 UsbChooserController::UsbChooserController(
45 content::RenderFrameHost* owner, 45 content::RenderFrameHost* owner,
46 mojo::Array<device::usb::DeviceFilterPtr> device_filters, 46 mojo::Array<device::usb::DeviceFilterPtr> device_filters,
47 content::RenderFrameHost* render_frame_host, 47 content::RenderFrameHost* render_frame_host,
48 const device::usb::ChooserService::GetPermissionCallback& callback) 48 const device::usb::ChooserService::GetPermissionCallback& callback)
49 : ChooserController(owner), 49 : ChooserController(owner,
50 IDS_USB_DEVICE_CHOOSER_PROMPT_ORIGIN,
51 IDS_USB_DEVICE_CHOOSER_PROMPT_EXTENSION_NAME),
50 render_frame_host_(render_frame_host), 52 render_frame_host_(render_frame_host),
51 callback_(callback), 53 callback_(callback),
52 usb_service_observer_(this), 54 usb_service_observer_(this),
53 weak_factory_(this) { 55 weak_factory_(this) {
54 device::UsbService* usb_service = 56 device::UsbService* usb_service =
55 device::DeviceClient::Get()->GetUsbService(); 57 device::DeviceClient::Get()->GetUsbService();
56 if (!usb_service) 58 if (!usb_service)
57 return; 59 return;
58 60
59 if (!usb_service_observer_.IsObserving(usb_service)) 61 if (!usb_service_observer_.IsObserving(usb_service))
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 177
176 bool UsbChooserController::DisplayDevice( 178 bool UsbChooserController::DisplayDevice(
177 scoped_refptr<device::UsbDevice> device) const { 179 scoped_refptr<device::UsbDevice> device) const {
178 return device::UsbDeviceFilter::MatchesAny(device, filters_) && 180 return device::UsbDeviceFilter::MatchesAny(device, filters_) &&
179 (base::CommandLine::ForCurrentProcess()->HasSwitch( 181 (base::CommandLine::ForCurrentProcess()->HasSwitch(
180 switches::kDisableWebUsbSecurity) || 182 switches::kDisableWebUsbSecurity) ||
181 device::FindInWebUsbAllowedOrigins( 183 device::FindInWebUsbAllowedOrigins(
182 device->webusb_allowed_origins(), 184 device->webusb_allowed_origins(),
183 render_frame_host_->GetLastCommittedURL().GetOrigin())); 185 render_frame_host_->GetLastCommittedURL().GetOrigin()));
184 } 186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698