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

Side by Side Diff: extensions/browser/api/networking_private/networking_private_linux.cc

Issue 1278973003: Revert of Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_linux.h" 5 #include "extensions/browser/api/networking_private/networking_private_linux.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const char kAccessPointSecurityWpaPsk[] = "WPA-PSK"; 44 const char kAccessPointSecurityWpaPsk[] = "WPA-PSK";
45 const char kAccessPointSecurity9021X[] = "WEP-8021X"; 45 const char kAccessPointSecurity9021X[] = "WEP-8021X";
46 46
47 // Parses the GUID which contains 3 pieces of relevant information. The 47 // Parses the GUID which contains 3 pieces of relevant information. The
48 // object path to the network device, the object path of the access point, 48 // object path to the network device, the object path of the access point,
49 // and the ssid. 49 // and the ssid.
50 bool ParseNetworkGuid(const std::string& guid, 50 bool ParseNetworkGuid(const std::string& guid,
51 std::string* device_path, 51 std::string* device_path,
52 std::string* access_point_path, 52 std::string* access_point_path,
53 std::string* ssid) { 53 std::string* ssid) {
54 std::vector<std::string> guid_parts = 54 std::vector<std::string> guid_parts;
55 base::SplitString(guid, "|", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 55
56 base::SplitString(guid, '|', &guid_parts);
57
56 if (guid_parts.size() != 3) { 58 if (guid_parts.size() != 3) {
57 return false; 59 return false;
58 } 60 }
59 61
60 *device_path = guid_parts[0]; 62 *device_path = guid_parts[0];
61 *access_point_path = guid_parts[1]; 63 *access_point_path = guid_parts[1];
62 *ssid = guid_parts[2]; 64 *ssid = guid_parts[2];
63 65
64 if (device_path->empty() || access_point_path->empty() || ssid->empty()) { 66 if (device_path->empty() || access_point_path->empty() || ssid->empty()) {
65 return false; 67 return false;
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 base::Unretained(this), base::Passed(&guid_list))); 1198 base::Unretained(this), base::Passed(&guid_list)));
1197 } 1199 }
1198 1200
1199 void NetworkingPrivateLinux::OnNetworksChangedEventTask( 1201 void NetworkingPrivateLinux::OnNetworksChangedEventTask(
1200 scoped_ptr<GuidList> guid_list) { 1202 scoped_ptr<GuidList> guid_list) {
1201 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 1203 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
1202 OnNetworksChangedEventOnUIThread(*guid_list); 1204 OnNetworksChangedEventOnUIThread(*guid_list);
1203 } 1205 }
1204 1206
1205 } // namespace extensions 1207 } // namespace extensions
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_helpers.cc ('k') | extensions/common/csp_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698