Index: chromeos/network/favorite_state.cc |
diff --git a/chromeos/network/favorite_state.cc b/chromeos/network/favorite_state.cc |
index 002ff4f463a7d1b7a72bd09b0d5abd5a431b07c5..daf981a2d714a64c1c0ec4d4c396f0ad265d41b7 100644 |
--- a/chromeos/network/favorite_state.cc |
+++ b/chromeos/network/favorite_state.cc |
@@ -63,6 +63,9 @@ bool FavoriteState::PropertyChanged(const std::string& key, |
NET_LOG_ERROR("Failed to parse " + key, path()); |
} |
return true; |
+ } else if (key == shill::kSecurityProperty) { |
+ // Only used for GetSpecifier() |
pneubeck (no reviews)
2014/05/12 13:37:07
this comment should be at the declaration of secur
stevenjb
2014/05/13 01:19:00
Done.
|
+ return GetStringValue(key, value, &security_); |
} |
return false; |
} |
@@ -79,8 +82,21 @@ void FavoriteState::GetStateProperties( |
ui_data_.GetONCSourceAsString()); |
} |
-bool FavoriteState::IsFavorite() const { |
- // kTypeEthernetEap is always a favorite. We need this check because it does |
+std::string FavoriteState::GetSpecifier() const { |
pneubeck (no reviews)
2014/05/12 13:37:07
I'd prefer to return "" as long as !update_receive
stevenjb
2014/05/13 01:19:00
Done.
|
+ if (type() == shill::kTypeWifi) |
+ return name() + "_" + security_; |
+ if (!name().empty()) |
+ return name(); |
+ return type(); // For unnamed networks such as ethernet. |
+} |
+ |
+void FavoriteState::SetGuid(const std::string& guid) { |
+ DCHECK(guid_.empty()); |
+ guid_ = guid; |
+} |
+ |
+bool FavoriteState::IsInProfile() const { |
+ // kTypeEthernetEap is always saved. We need this check because it does |
// not show up in the visible list, but its properties may not be available |
// when it first shows up in ServiceCompleteList. See crbug.com/355117. |
return !profile_path_.empty() || type() == shill::kTypeEthernetEap; |