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

Unified Diff: chromeos/dbus/shill_service_client.cc

Issue 12220113: Next phase for chrome.networkingPrivate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/shill_service_client.cc
diff --git a/chromeos/dbus/shill_service_client.cc b/chromeos/dbus/shill_service_client.cc
index efc92436204b29a5911fb252a9b3ab9bd2d3dcb4..ec48be4a59aced5566962d65cc1e1a59ad03fa3d 100644
--- a/chromeos/dbus/shill_service_client.cc
+++ b/chromeos/dbus/shill_service_client.cc
@@ -9,6 +9,8 @@
#include "base/message_loop.h"
#include "base/stl_util.h"
#include "base/values.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/shill_manager_client.h"
#include "chromeos/dbus/shill_property_changed_observer.h"
#include "dbus/bus.h"
#include "dbus/message.h"
@@ -247,6 +249,18 @@ class ShillServiceClientStubImpl : public ShillServiceClient,
error_callback.Run("StubError", "Service not found");
return;
}
+ if (name == flimflam::kStateProperty) {
+ // If we connect to a service, then we move it to the top of the list in
+ // the manager client.
+ std::string state;
+ if (value.GetAsString(&state) && state == flimflam::kStateOnline) {
+ ShillManagerClient* manager_client =
+ DBusThreadManager::Get()->GetShillManagerClient();
+ manager_client->GetTestInterface()->RemoveService(service_path.value());
+ manager_client->GetTestInterface()->AddServiceAtIndex(
+ service_path.value(), 0, true);
+ }
+ }
dict->SetWithoutPathExpansion(name, value.DeepCopy());
MessageLoop::current()->PostTask(
FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698