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 |
| 78 // Note: The following are added for debugging, but do not translate to ONC. |
77 dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, | 79 dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, |
78 profile_path()); | 80 profile_path()); |
79 // Add ONCSource for debugging. | |
80 dictionary->SetStringWithoutPathExpansion(NetworkUIData::kKeyONCSource, | 81 dictionary->SetStringWithoutPathExpansion(NetworkUIData::kKeyONCSource, |
81 ui_data_.GetONCSourceAsString()); | 82 ui_data_.GetONCSourceAsString()); |
82 } | 83 } |
83 | 84 |
84 std::string FavoriteState::GetSpecifier() const { | 85 std::string FavoriteState::GetSpecifier() const { |
85 if (!update_received()) { | 86 if (!update_received()) { |
86 NET_LOG_ERROR("GetSpecifier called before update", path()); | 87 NET_LOG_ERROR("GetSpecifier called before update", path()); |
87 return std::string(); | 88 return std::string(); |
88 } | 89 } |
89 if (type() == shill::kTypeWifi) | 90 if (type() == shill::kTypeWifi) |
(...skipping 14 matching lines...) Expand all Loading... |
104 // when it first shows up in ServiceCompleteList. See crbug.com/355117. | 105 // when it first shows up in ServiceCompleteList. See crbug.com/355117. |
105 return !profile_path_.empty() || type() == shill::kTypeEthernetEap; | 106 return !profile_path_.empty() || type() == shill::kTypeEthernetEap; |
106 } | 107 } |
107 | 108 |
108 bool FavoriteState::IsPrivate() const { | 109 bool FavoriteState::IsPrivate() const { |
109 return !profile_path_.empty() && | 110 return !profile_path_.empty() && |
110 profile_path_ != NetworkProfileHandler::GetSharedProfilePath(); | 111 profile_path_ != NetworkProfileHandler::GetSharedProfilePath(); |
111 } | 112 } |
112 | 113 |
113 } // namespace chromeos | 114 } // namespace chromeos |
OLD | NEW |