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

Unified Diff: chromeos/network/onc/onc_utils.cc

Issue 759663004: ONC: add support for non-utf-8 SSIDs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
Index: chromeos/network/onc/onc_utils.cc
diff --git a/chromeos/network/onc/onc_utils.cc b/chromeos/network/onc/onc_utils.cc
index fdff42dbd9d3983db5ebf1aa68f7dfc5ee2fdb30..50a280617947e80b32e0a5e27cadd632206b81da 100644
--- a/chromeos/network/onc/onc_utils.cc
+++ b/chromeos/network/onc/onc_utils.cc
@@ -8,6 +8,7 @@
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "chromeos/network/network_event_log.h"
@@ -240,6 +241,18 @@ void ExpandStringsInNetworks(const StringSubstitution& substitution,
}
}
+void FillInHexSSIDField(base::DictionaryValue* wifi_fields) {
+ if (!wifi_fields->HasKey(::onc::wifi::kHexSSID)) {
+ std::string ssid_string;
+ wifi_fields->GetStringWithoutPathExpansion(::onc::wifi::kSSID,
+ &ssid_string);
+ std::string hex_ssid_string;
pneubeck (no reviews) 2014/11/26 10:15:34 nit: merge both lines and use c'tor arguments inst
cschuet (SLOW) 2014/11/27 11:03:58 Done.
+ hex_ssid_string = base::HexEncode(ssid_string.c_str(), ssid_string.size());
+ wifi_fields->SetStringWithoutPathExpansion(::onc::wifi::kHexSSID,
+ hex_ssid_string);
+ }
+}
+
namespace {
class OncMaskValues : public Mapper {

Powered by Google App Engine
This is Rietveld 408576698