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

Unified Diff: chromeos/dbus/shill_service_client_stub.cc

Issue 22340006: Show notifications for Network Config errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + move comment Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/options/wifi_config_view.cc ('k') | chromeos/network/network_connection_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/shill_service_client_stub.cc
diff --git a/chromeos/dbus/shill_service_client_stub.cc b/chromeos/dbus/shill_service_client_stub.cc
index 5060650f702187dc3a5680517a2e929c18f40299..03d7b75d7458752aa06e33a32779a17658258f0d 100644
--- a/chromeos/dbus/shill_service_client_stub.cc
+++ b/chromeos/dbus/shill_service_client_stub.cc
@@ -165,8 +165,9 @@ void ShillServiceClientStub::Connect(const dbus::ObjectPath& service_path,
const base::Closure& callback,
const ErrorCallback& error_callback) {
VLOG(1) << "ShillServiceClientStub::Connect: " << service_path.value();
- base::Value* service;
- if (!stub_services_.Get(service_path.value(), &service)) {
+ base::DictionaryValue* service_properties;
+ if (!stub_services_.GetDictionary(
+ service_path.value(), &service_properties)) {
LOG(ERROR) << "Service not found: " << service_path.value();
error_callback.Run("Error.InvalidService", "Invalid Service");
return;
@@ -191,6 +192,11 @@ void ShillServiceClientStub::Connect(const dbus::ObjectPath& service_path,
delay = base::TimeDelta::FromSeconds(kConnectDelaySeconds);
}
base::StringValue online_value(flimflam::kStateOnline);
+ std::string passphrase;
+ service_properties->GetStringWithoutPathExpansion(
+ flimflam::kPassphraseProperty, &passphrase);
+ if (passphrase == "failure")
+ online_value = base::StringValue(flimflam::kStateFailure);
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&ShillServiceClientStub::SetProperty,
@@ -202,6 +208,19 @@ void ShillServiceClientStub::Connect(const dbus::ObjectPath& service_path,
error_callback),
delay);
callback.Run();
+ // On failure, also set the Error property.
+ if (passphrase == "failure") {
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ShillServiceClientStub::SetProperty,
+ weak_ptr_factory_.GetWeakPtr(),
+ service_path,
+ flimflam::kErrorProperty,
+ base::StringValue(flimflam::kErrorBadPassphrase),
+ base::Bind(&base::DoNothing),
+ error_callback),
+ delay);
+ }
}
void ShillServiceClientStub::Disconnect(const dbus::ObjectPath& service_path,
« no previous file with comments | « chrome/browser/chromeos/options/wifi_config_view.cc ('k') | chromeos/network/network_connection_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698