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

Side by Side Diff: chrome/browser/extensions/api/serial/serial_port_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: -___- 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) 2012 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 "chrome/browser/extensions/api/serial/serial_port_enumerator.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 extensions {
15
16 SerialPortEnumerator::StringSet
17 SerialPortEnumerator::GenerateValidSerialPortNames() {
18 StringSet name_set;
19
20 base::win::RegistryValueIterator iter_key(HKEY_LOCAL_MACHINE,
21 L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\");
22
23 for (; iter_key.Valid(); ++iter_key) {
24 base::string16 str(iter_key.Value());
25 std::string device_string(WideToASCII(str));
26 name_set.insert(device_string);
27 }
28 return name_set;
29 }
30
31 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/serial/serial_port_enumerator_unittest.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698