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

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

Issue 23904025: Move IsRunningOnChromeOS to SysInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fix Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/flags_ui.cc ('k') | chromeos/cert_loader.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_device.h" 5 #include "chrome/browser/usb/usb_device.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "chrome/browser/usb/usb_context.h" 10 #include "chrome/browser/usb/usb_context.h"
11 #include "chrome/browser/usb/usb_device_handle.h" 11 #include "chrome/browser/usb/usb_device_handle.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "third_party/libusb/src/libusb/libusb.h" 13 #include "third_party/libusb/src/libusb/libusb.h"
14 14
15 #if defined(OS_CHROMEOS) 15 #if defined(OS_CHROMEOS)
16 #include "base/chromeos/chromeos_version.h" 16 #include "base/sys_info.h"
17 #include "chromeos/dbus/dbus_thread_manager.h" 17 #include "chromeos/dbus/dbus_thread_manager.h"
18 #include "chromeos/dbus/permission_broker_client.h" 18 #include "chromeos/dbus/permission_broker_client.h"
19 #endif // defined(OS_CHROMEOS) 19 #endif // defined(OS_CHROMEOS)
20 20
21 using content::BrowserThread; 21 using content::BrowserThread;
22 22
23 namespace { 23 namespace {
24 24
25 void OnRequestUsbAccessReplied( 25 void OnRequestUsbAccessReplied(
26 const base::Callback<void(bool success)>& callback, 26 const base::Callback<void(bool success)>& callback,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 #if defined(OS_CHROMEOS) 68 #if defined(OS_CHROMEOS)
69 69
70 void UsbDevice::RequestUsbAcess( 70 void UsbDevice::RequestUsbAcess(
71 int interface_id, 71 int interface_id,
72 const base::Callback<void(bool success)>& callback) { 72 const base::Callback<void(bool success)>& callback) {
73 DCHECK(thread_checker_.CalledOnValidThread()); 73 DCHECK(thread_checker_.CalledOnValidThread());
74 74
75 // ChromeOS builds on non-ChromeOS machines (dev) should not attempt to 75 // ChromeOS builds on non-ChromeOS machines (dev) should not attempt to
76 // use permission broker. 76 // use permission broker.
77 if (base::chromeos::IsRunningOnChromeOS()) { 77 if (base::SysInfo::IsRunningOnChromeOS()) {
78 chromeos::PermissionBrokerClient* client = 78 chromeos::PermissionBrokerClient* client =
79 chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient(); 79 chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient();
80 DCHECK(client) << "Could not get permission broker client."; 80 DCHECK(client) << "Could not get permission broker client.";
81 if (!client) { 81 if (!client) {
82 callback.Run(false); 82 callback.Run(false);
83 return; 83 return;
84 } 84 }
85 85
86 BrowserThread::PostTask( 86 BrowserThread::PostTask(
87 BrowserThread::UI, FROM_HERE, 87 BrowserThread::UI, FROM_HERE,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 DCHECK(thread_checker_.CalledOnValidThread()); 143 DCHECK(thread_checker_.CalledOnValidThread());
144 HandlesVector handles; 144 HandlesVector handles;
145 swap(handles, handles_); 145 swap(handles, handles_);
146 for (std::vector<scoped_refptr<UsbDeviceHandle> >::iterator it = 146 for (std::vector<scoped_refptr<UsbDeviceHandle> >::iterator it =
147 handles.begin(); 147 handles.begin();
148 it != handles.end(); 148 it != handles.end();
149 ++it) { 149 ++it) {
150 (*it)->InternalClose(); 150 (*it)->InternalClose();
151 } 151 }
152 } 152 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/flags_ui.cc ('k') | chromeos/cert_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698