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

Side by Side Diff: device/serial/serial_device_enumerator_win.cc

Issue 158063002: Use udev for serial device enumeration on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: doc nits Created 6 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "device/serial/serial_device_enumerator_win.h"
6
7 #include <windows.h>
8
9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h"
11 #include "base/strings/stringprintf.h"
12 #include "base/win/registry.h"
13
14 namespace device {
15
16 // static
17 scoped_ptr<SerialDeviceEnumerator> SerialDeviceEnumerator::Create() {
18 return scoped_ptr<SerialDeviceEnumerator>(new SerialDeviceEnumeratorWin());
19 }
20
21 SerialDeviceEnumeratorWin::SerialDeviceEnumeratorWin() {}
22
23 SerialDeviceEnumeratorWin::~SerialDeviceEnumeratorWin() {}
24
25 void SerialDeviceEnumeratorWin::GetDevices(
26 std::vector<SerialDeviceInfo>* devices) {
27 devices->clear();
28
29 base::win::RegistryValueIterator iter_key(
30 HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\");
31 for (; iter_key.Valid(); ++iter_key) {
32 base::string16 value(iter_key.Value());
33 SerialDeviceInfo info;
34 info.path = WideToASCII(value);
35 devices->push_back(info);
36 }
37 }
38
39 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698