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

Unified Diff: chromeos/dbus/shill_manager_client_stub.cc

Issue 12387065: Convert TrayVPN to use new NetworkState code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser_tests 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
« no previous file with comments | « chromeos/dbus/shill_manager_client_stub.h ('k') | chromeos/dbus/shill_service_client_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/shill_manager_client_stub.cc
diff --git a/chromeos/dbus/shill_manager_client_stub.cc b/chromeos/dbus/shill_manager_client_stub.cc
index 9132e9e922e73a1c0714eb1a7ddae7eebd149958..2a74567ad4e96a68c44247de6902aac9c0853a6d 100644
--- a/chromeos/dbus/shill_manager_client_stub.cc
+++ b/chromeos/dbus/shill_manager_client_stub.cc
@@ -242,6 +242,11 @@ void ShillManagerClientStub::ClearDevices() {
stub_properties_.Remove(flimflam::kDevicesProperty, NULL);
}
+void ShillManagerClientStub::ClearServices() {
+ stub_properties_.Remove(flimflam::kServicesProperty, NULL);
+ stub_properties_.Remove(flimflam::kServiceWatchListProperty, NULL);
+}
+
void ShillManagerClientStub::AddService(const std::string& service_path,
bool add_to_watch_list) {
if (GetListProperty(flimflam::kServicesProperty)->AppendIfNotPresent(
@@ -414,6 +419,8 @@ base::ListValue* ShillManagerClientStub::GetListProperty(
}
bool ShillManagerClientStub::TechnologyEnabled(const std::string& type) const {
+ if (type == flimflam::kTypeVPN)
+ return true; // VPN is always "enabled" since there is no associated device
bool enabled = false;
const base::ListValue* technologies;
if (stub_properties_.GetListWithoutPathExpansion(
@@ -439,6 +446,10 @@ base::ListValue* ShillManagerClientStub::GetEnabledServiceList(
continue;
const base::DictionaryValue* properties =
service_client->GetServiceProperties(service_path);
+ if (!properties) {
+ LOG(ERROR) << "Properties not found for service: " << service_path;
+ continue;
+ }
std::string name;
properties->GetString(flimflam::kNameProperty, &name);
std::string type;
« no previous file with comments | « chromeos/dbus/shill_manager_client_stub.h ('k') | chromeos/dbus/shill_service_client_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698