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

Unified Diff: chromeos/network/network_util.cc

Issue 383013002: Remove additional dependencies from InternetOptionsHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« chromeos/network/network_state.h ('K') | « chromeos/network/network_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_util.cc
diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc
index bcec78d0384f7bbc9af75fba47c64ab6069230f0..19f05b1af92a45545bcaac7e48ce76a42ce92ff6 100644
--- a/chromeos/network/network_util.cc
+++ b/chromeos/network/network_util.cc
@@ -7,11 +7,14 @@
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "chromeos/login/login_state.h"
+#include "chromeos/network/managed_network_configuration_handler.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/onc/onc_signature.h"
#include "chromeos/network/onc/onc_translation_tables.h"
#include "chromeos/network/onc/onc_translator.h"
+#include "chromeos/network/onc/onc_utils.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos {
@@ -162,6 +165,10 @@ scoped_ptr<base::ListValue> TranslateNetworkListToONC(
NetworkHandler::Get()->network_state_handler()->GetNetworkListByType(
pattern, configured_only, visible_only, limit, &network_states);
+ std::string userhash = LoginState::Get()->primary_user_hash();
pneubeck (no reviews) 2014/07/11 20:35:07 It seems to me that this is unexpected and will ev
stevenjb 2014/07/11 21:26:10 I'll rip this out for now, it's handy but not wort
+ ManagedNetworkConfigurationHandler* config_handler =
+ NetworkHandler::Get()->managed_network_configuration_handler();
+
scoped_ptr<base::ListValue> network_properties_list(new base::ListValue);
for (NetworkStateHandler::NetworkStateList::iterator it =
network_states.begin();
@@ -175,9 +182,10 @@ scoped_ptr<base::ListValue> TranslateNetworkListToONC(
onc_dictionary->SetBoolean("visible", (*it)->visible());
onc_dictionary->SetString("profile_path", (*it)->profile_path());
onc_dictionary->SetString("service_path", (*it)->path());
- std::string onc_source = (*it)->ui_data().GetONCSourceAsString();
- if (!onc_source.empty())
- onc_dictionary->SetString("onc_source", onc_source);
+ ::onc::ONCSource onc_source;
+ config_handler->FindPolicyByGUID(userhash, (*it)->guid(), &onc_source);
+ onc_dictionary->SetString("onc_source",
+ onc::GetSourceAsString(onc_source));
}
network_properties_list->Append(onc_dictionary.release());
« chromeos/network/network_state.h ('K') | « chromeos/network/network_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698