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

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: win typo 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
24 SerialDeviceEnumeratorWin::~SerialDeviceEnumeratorWin() {
25 }
26
27 void SerialDeviceEnumeratorWin::GetDevices(
28 std::vector<SerialDeviceInfo>* devices) {
29 devices->clear();
30
31 base::win::RegistryValueIterator iter_key(HKEY_LOCAL_MACHINE,
32 L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\");
33 for (; iter_key.Valid(); ++iter_key) {
34 base::string16 value(iter_key.Value());
35 SerialDeviceInfo info;
36 info.path = WideToASCII(value);
37 devices->push_back(info);
38 }
39 }
40
41 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698