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

Unified Diff: chromeos/network/network_state.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 | « chromeos/network/network_state.h ('k') | chromeos/network/network_state_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state.cc
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc
index c196473b1203b46e1fc31c0f5a1a6aa2dff0fa3e..deff6475dec31fab136229afff8bd34ece3353a0 100644
--- a/chromeos/network/network_state.cc
+++ b/chromeos/network/network_state.cc
@@ -19,6 +19,8 @@
namespace {
+const char kErrorUnknown[] = "Unknown";
+
bool ConvertListValueToStringVector(const base::ListValue& string_list,
std::vector<std::string>* result) {
for (size_t i = 0; i < string_list.GetSize(); ++i) {
@@ -109,7 +111,12 @@ bool NetworkState::PropertyChanged(const std::string& key,
} else if (key == flimflam::kConnectableProperty) {
return GetBooleanValue(key, value, &connectable_);
} else if (key == flimflam::kErrorProperty) {
- return GetStringValue(key, value, &error_);
+ if (!GetStringValue(key, value, &error_))
+ return false;
+ // Shill uses "Unknown" to indicate an unset error state.
+ if (error_ == kErrorUnknown)
+ error_.clear();
+ return true;
} else if (key == shill::kErrorDetailsProperty) {
return GetStringValue(key, value, &error_details_);
} else if (key == IPConfigProperty(flimflam::kAddressProperty)) {
« no previous file with comments | « chromeos/network/network_state.h ('k') | chromeos/network/network_state_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698