| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/network/favorite_state.h" | 5 #include "chromeos/network/favorite_state.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chromeos/network/network_event_log.h" | 10 #include "chromeos/network/network_event_log.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return GetStringValue(key, value, &security_); | 67 return GetStringValue(key, value, &security_); |
| 68 } | 68 } |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void FavoriteState::GetStateProperties( | 72 void FavoriteState::GetStateProperties( |
| 73 base::DictionaryValue* dictionary) const { | 73 base::DictionaryValue* dictionary) const { |
| 74 ManagedState::GetStateProperties(dictionary); | 74 ManagedState::GetStateProperties(dictionary); |
| 75 | 75 |
| 76 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); | 76 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); |
| 77 dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty, |
| 78 security_); |
| 79 |
| 80 // Note: The following are added for debugging, but do not translate to ONC. |
| 77 dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, | 81 dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, |
| 78 profile_path()); | 82 profile_path()); |
| 79 // Add ONCSource for debugging. | |
| 80 dictionary->SetStringWithoutPathExpansion(NetworkUIData::kKeyONCSource, | 83 dictionary->SetStringWithoutPathExpansion(NetworkUIData::kKeyONCSource, |
| 81 ui_data_.GetONCSourceAsString()); | 84 ui_data_.GetONCSourceAsString()); |
| 82 } | 85 } |
| 83 | 86 |
| 84 std::string FavoriteState::GetSpecifier() const { | 87 std::string FavoriteState::GetSpecifier() const { |
| 85 if (!update_received()) { | 88 if (!update_received()) { |
| 86 NET_LOG_ERROR("GetSpecifier called before update", path()); | 89 NET_LOG_ERROR("GetSpecifier called before update", path()); |
| 87 return std::string(); | 90 return std::string(); |
| 88 } | 91 } |
| 89 if (type() == shill::kTypeWifi) | 92 if (type() == shill::kTypeWifi) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 104 // when it first shows up in ServiceCompleteList. See crbug.com/355117. | 107 // when it first shows up in ServiceCompleteList. See crbug.com/355117. |
| 105 return !profile_path_.empty() || type() == shill::kTypeEthernetEap; | 108 return !profile_path_.empty() || type() == shill::kTypeEthernetEap; |
| 106 } | 109 } |
| 107 | 110 |
| 108 bool FavoriteState::IsPrivate() const { | 111 bool FavoriteState::IsPrivate() const { |
| 109 return !profile_path_.empty() && | 112 return !profile_path_.empty() && |
| 110 profile_path_ != NetworkProfileHandler::GetSharedProfilePath(); | 113 profile_path_ != NetworkProfileHandler::GetSharedProfilePath(); |
| 111 } | 114 } |
| 112 | 115 |
| 113 } // namespace chromeos | 116 } // namespace chromeos |
| OLD | NEW |