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

Side by Side Diff: chromeos/dbus/fake_shill_manager_client.cc

Issue 275543005: Use GUID instead of ServicePath in networkingPrivate API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/dbus/fake_shill_manager_client.h" 5 #include "chromeos/dbus/fake_shill_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 std::string ipconfig_path; 244 std::string ipconfig_path;
245 properties.GetString(shill::kIPConfigProperty, &ipconfig_path); 245 properties.GetString(shill::kIPConfigProperty, &ipconfig_path);
246 246
247 // Merge the new properties with existing properties, if any. 247 // Merge the new properties with existing properties, if any.
248 const base::DictionaryValue* existing_properties = 248 const base::DictionaryValue* existing_properties =
249 service_client->GetServiceProperties(service_path); 249 service_client->GetServiceProperties(service_path);
250 if (!existing_properties) { 250 if (!existing_properties) {
251 // Add a new service to the service client stub because none exists, yet. 251 // Add a new service to the service client stub because none exists, yet.
252 // This calls AddManagerService. 252 // This calls AddManagerService.
253 service_client->AddServiceWithIPConfig(service_path, guid, type, 253 service_client->AddServiceWithIPConfig(service_path, guid, guid, type,
pneubeck (no reviews) 2014/05/12 13:37:07 nit: add inline comments to clarify the two 'guid'
stevenjb 2014/05/13 01:19:00 Done.
254 shill::kStateIdle, ipconfig_path, 254 shill::kStateIdle, ipconfig_path,
255 true /* visible */, 255 true /* visible */,
256 true /* watch */); 256 true /* watch */);
257 existing_properties = service_client->GetServiceProperties(service_path); 257 existing_properties = service_client->GetServiceProperties(service_path);
258 } 258 }
259 259
260 scoped_ptr<base::DictionaryValue> merged_properties( 260 scoped_ptr<base::DictionaryValue> merged_properties(
261 existing_properties->DeepCopy()); 261 existing_properties->DeepCopy());
262 merged_properties->MergeDictionary(&properties); 262 merged_properties->MergeDictionary(&properties);
263 263
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 *enabled = true; 1028 *enabled = true;
1029 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || 1029 if ((state == shill::kStatePortal && type != shill::kTypeWifi) ||
1030 (state == kNetworkActivated && type != shill::kTypeCellular)) { 1030 (state == kNetworkActivated && type != shill::kTypeCellular)) {
1031 LOG(WARNING) << "Invalid state: " << state << " for " << type; 1031 LOG(WARNING) << "Invalid state: " << state << " for " << type;
1032 return shill::kStateIdle; 1032 return shill::kStateIdle;
1033 } 1033 }
1034 return state; 1034 return state;
1035 } 1035 }
1036 1036
1037 } // namespace chromeos 1037 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698