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

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

Issue 2417043002: Move device/core files to device/base directory. (Closed)
Patch Set: Fix ChromeOS build Created 4 years, 2 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 | « chrome/browser/usb/DEPS ('k') | chrome/browser/usb/usb_chooser_context_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_context.h" 5 #include "chrome/browser/usb/usb_chooser_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "device/core/device_client.h" 16 #include "device/base/device_client.h"
17 #include "device/usb/public/interfaces/device.mojom.h" 17 #include "device/usb/public/interfaces/device.mojom.h"
18 #include "device/usb/usb_device.h" 18 #include "device/usb/usb_device.h"
19 19
20 using device::UsbDevice; 20 using device::UsbDevice;
21 21
22 namespace { 22 namespace {
23 23
24 const char kDeviceNameKey[] = "name"; 24 const char kDeviceNameKey[] = "name";
25 const char kGuidKey[] = "ephemeral-guid"; 25 const char kGuidKey[] = "ephemeral-guid";
26 const char kProductIdKey[] = "product-id"; 26 const char kProductIdKey[] = "product-id";
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 bool UsbChooserContext::IsValidObject(const base::DictionaryValue& object) { 186 bool UsbChooserContext::IsValidObject(const base::DictionaryValue& object) {
187 return object.size() == 4 && object.HasKey(kDeviceNameKey) && 187 return object.size() == 4 && object.HasKey(kDeviceNameKey) &&
188 object.HasKey(kVendorIdKey) && object.HasKey(kProductIdKey) && 188 object.HasKey(kVendorIdKey) && object.HasKey(kProductIdKey) &&
189 object.HasKey(kSerialNumberKey); 189 object.HasKey(kSerialNumberKey);
190 } 190 }
191 191
192 void UsbChooserContext::OnDeviceRemoved(scoped_refptr<UsbDevice> device) { 192 void UsbChooserContext::OnDeviceRemoved(scoped_refptr<UsbDevice> device) {
193 for (auto& map_entry : ephemeral_devices_) 193 for (auto& map_entry : ephemeral_devices_)
194 map_entry.second.erase(device->guid()); 194 map_entry.second.erase(device->guid());
195 } 195 }
OLDNEW
« no previous file with comments | « chrome/browser/usb/DEPS ('k') | chrome/browser/usb/usb_chooser_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698