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

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

Issue 275543005: Use GUID instead of ServicePath in networkingPrivate API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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_service_client.h" 5 #include "chromeos/dbus/fake_shill_service_client.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/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 303
304 // ShillServiceClient::TestInterface overrides. 304 // ShillServiceClient::TestInterface overrides.
305 305
306 void FakeShillServiceClient::AddService(const std::string& service_path, 306 void FakeShillServiceClient::AddService(const std::string& service_path,
307 const std::string& name, 307 const std::string& name,
308 const std::string& type, 308 const std::string& type,
309 const std::string& state, 309 const std::string& state,
310 bool add_to_visible_list, 310 bool add_to_visible_list,
311 bool add_to_watch_list) { 311 bool add_to_watch_list) {
312 AddServiceWithIPConfig(service_path, name, type, state, "", 312 AddServiceWithIPConfig(service_path, "" /* guid */, name,
313 type, state, "" /* ipconfig_path */,
313 add_to_visible_list, add_to_watch_list); 314 add_to_visible_list, add_to_watch_list);
314 } 315 }
315 316
316 void FakeShillServiceClient::AddServiceWithIPConfig( 317 void FakeShillServiceClient::AddServiceWithIPConfig(
317 const std::string& service_path, 318 const std::string& service_path,
319 const std::string& guid,
318 const std::string& name, 320 const std::string& name,
319 const std::string& type, 321 const std::string& type,
320 const std::string& state, 322 const std::string& state,
321 const std::string& ipconfig_path, 323 const std::string& ipconfig_path,
322 bool add_to_visible_list, 324 bool add_to_visible_list,
323 bool add_to_watch_list) { 325 bool add_to_watch_list) {
324 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> 326 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()->
325 AddManagerService(service_path, add_to_visible_list, add_to_watch_list); 327 AddManagerService(service_path, add_to_visible_list, add_to_watch_list);
326 std::string device_path = 328 std::string device_path =
327 DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface()-> 329 DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface()->
328 GetDevicePathForType(type); 330 GetDevicePathForType(type);
329 331
330 base::DictionaryValue* properties = 332 base::DictionaryValue* properties =
331 GetModifiableServiceProperties(service_path, true); 333 GetModifiableServiceProperties(service_path, true);
332 connect_behavior_.erase(service_path); 334 connect_behavior_.erase(service_path);
335 if (!guid.empty()) {
pneubeck (no reviews) 2014/05/08 13:25:12 if the assumption is from now on that a service al
stevenjb 2014/05/08 22:32:26 The NetworkHandler layer enfoces that a service al
pneubeck (no reviews) 2014/05/12 13:37:07 oops. yes, you're right.
336 properties->SetWithoutPathExpansion(
337 shill::kGuidProperty,
338 base::Value::CreateStringValue(guid));
339 }
333 shill_property_util::SetSSID(name, properties); 340 shill_property_util::SetSSID(name, properties);
334 properties->SetWithoutPathExpansion( 341 properties->SetWithoutPathExpansion(
335 shill::kNameProperty, 342 shill::kNameProperty,
336 base::Value::CreateStringValue(name)); 343 base::Value::CreateStringValue(name));
337 properties->SetWithoutPathExpansion( 344 properties->SetWithoutPathExpansion(
338 shill::kDeviceProperty, 345 shill::kDeviceProperty,
339 base::Value::CreateStringValue(device_path)); 346 base::Value::CreateStringValue(device_path));
340 properties->SetWithoutPathExpansion( 347 properties->SetWithoutPathExpansion(
341 shill::kTypeProperty, 348 shill::kTypeProperty,
342 base::Value::CreateStringValue(type)); 349 base::Value::CreateStringValue(type));
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 base::StringValue(shill::kErrorBadPassphrase))); 564 base::StringValue(shill::kErrorBadPassphrase)));
558 } else { 565 } else {
559 // Set Online. 566 // Set Online.
560 SetServiceProperty(service_path, 567 SetServiceProperty(service_path,
561 shill::kStateProperty, 568 shill::kStateProperty,
562 base::StringValue(shill::kStateOnline)); 569 base::StringValue(shill::kStateOnline));
563 } 570 }
564 } 571 }
565 572
566 } // namespace chromeos 573 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698