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

Side by Side Diff: chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/extensions/api/serial/serial_port_enumerator.h" 5 #include "chrome/browser/extensions/api/serial/serial_port_enumerator.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/win/registry.h" 10 #include "base/win/registry.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 SerialPortEnumerator::StringSet 16 SerialPortEnumerator::StringSet
17 SerialPortEnumerator::GenerateValidSerialPortNames() { 17 SerialPortEnumerator::GenerateValidSerialPortNames() {
18 StringSet name_set; 18 StringSet name_set;
19 19
20 base::win::RegistryValueIterator iter_key(HKEY_LOCAL_MACHINE, 20 base::win::RegistryValueIterator iter_key(HKEY_LOCAL_MACHINE,
21 L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\"); 21 L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\");
22 22
23 for (; iter_key.Valid(); ++iter_key) { 23 for (; iter_key.Valid(); ++iter_key) {
24 string16 str(iter_key.Value()); 24 string16 str(iter_key.Value());
25 std::string device_string(WideToASCII(str)); 25 std::string device_string(base::WideToASCII(str));
26 name_set.insert(device_string); 26 name_set.insert(device_string);
27 } 27 }
28 return name_set; 28 return name_set;
29 } 29 }
30 30
31 } // namespace extensions 31 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698