Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/network_util.h" | 5 #include "chromeos/network/network_util.h" |
| 6 | 6 |
| 7 #include "base/strings/string_tokenizer.h" | 7 #include "base/strings/string_tokenizer.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chromeos/network/favorite_state.h" | 10 #include "chromeos/network/favorite_state.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 scoped_ptr<base::DictionaryValue> onc_dictionary = | 160 scoped_ptr<base::DictionaryValue> onc_dictionary = |
| 161 TranslateShillServiceToONCPart( | 161 TranslateShillServiceToONCPart( |
| 162 shill_dictionary, &onc::kNetworkWithStateSignature); | 162 shill_dictionary, &onc::kNetworkWithStateSignature); |
| 163 return onc_dictionary.Pass(); | 163 return onc_dictionary.Pass(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 scoped_ptr<base::ListValue> TranslateNetworkListToONC( | 166 scoped_ptr<base::ListValue> TranslateNetworkListToONC( |
| 167 NetworkTypePattern pattern, | 167 NetworkTypePattern pattern, |
| 168 bool configured_only, | 168 bool configured_only, |
| 169 bool visible_only, | 169 bool visible_only, |
| 170 int limit) { | 170 int limit, |
| 171 bool debugging_properties) { | |
| 171 NetworkStateHandler::FavoriteStateList favorite_states; | 172 NetworkStateHandler::FavoriteStateList favorite_states; |
| 172 NetworkHandler::Get()->network_state_handler()->GetFavoriteListByType( | 173 NetworkHandler::Get()->network_state_handler()->GetFavoriteListByType( |
| 173 pattern, configured_only, visible_only, limit, &favorite_states); | 174 pattern, configured_only, visible_only, limit, &favorite_states); |
| 174 | 175 |
| 175 scoped_ptr<base::ListValue> network_properties_list(new base::ListValue); | 176 scoped_ptr<base::ListValue> network_properties_list(new base::ListValue); |
| 176 for (NetworkStateHandler::FavoriteStateList::iterator it = | 177 for (NetworkStateHandler::FavoriteStateList::iterator it = |
| 177 favorite_states.begin(); | 178 favorite_states.begin(); |
| 178 it != favorite_states.end(); | 179 it != favorite_states.end(); |
| 179 ++it) { | 180 ++it) { |
| 180 scoped_ptr<base::DictionaryValue> onc_dictionary = | 181 scoped_ptr<base::DictionaryValue> onc_dictionary = |
| 181 TranslateFavoriteStateToONC(*it); | 182 TranslateFavoriteStateToONC(*it); |
| 183 | |
| 184 if (debugging_properties) { | |
| 185 onc_dictionary->SetString("profile_path", (*it)->profile_path()); | |
|
pneubeck (no reviews)
2014/05/22 16:24:20
SetString -> SetStringWithoutPathExpansion
maybe
stevenjb
2014/05/23 21:50:59
So, when using a literal, I've not been bothering
| |
| 186 std::string onc_source = (*it)->ui_data().GetONCSourceAsString(); | |
| 187 if (!onc_source.empty()) | |
| 188 onc_dictionary->SetString("onc_source", onc_source); | |
|
pneubeck (no reviews)
2014/05/22 16:24:20
In network_ui.js you use "OncSource", maybe out of
stevenjb
2014/05/23 21:50:59
Done.
| |
| 189 } | |
| 190 | |
| 182 network_properties_list->Append(onc_dictionary.release()); | 191 network_properties_list->Append(onc_dictionary.release()); |
| 183 } | 192 } |
| 184 return network_properties_list.Pass(); | 193 return network_properties_list.Pass(); |
| 185 } | 194 } |
| 186 | 195 |
| 187 } // namespace network_util | 196 } // namespace network_util |
| 188 } // namespace chromeos | 197 } // namespace chromeos |
| OLD | NEW |