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

Unified Diff: components/wifi_sync/wifi_credential.h

Issue 809803005: wifi_sync: add ability to convert WifiCredential to onc properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-4.0-wifi-security-class
Patch Set: Created 5 years, 11 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
Index: components/wifi_sync/wifi_credential.h
diff --git a/components/wifi_sync/wifi_credential.h b/components/wifi_sync/wifi_credential.h
index 7c0342a6c7e142049e9d78854b1cf98d69cd26a9..a6d267a09d7a237d5c32b18e4f4cea301f693ee4 100644
--- a/components/wifi_sync/wifi_credential.h
+++ b/components/wifi_sync/wifi_credential.h
@@ -13,6 +13,10 @@
#include "components/wifi_sync/wifi_security_class.h"
+namespace base {
+class DictionaryValue;
+}
+
namespace wifi_sync {
// A container to hold the information required to locate and connect
@@ -36,6 +40,12 @@ class WifiCredential final { // final because the class is copyable
WifiSecurityClass security_class() const { return security_class_; }
const std::string& passphrase() const { return passphrase_; }
+ // Updates |onc_properties|, adding elements which represent the ONC
+ // properties for this credential. The resulting |onc_properties|
+ // can be used, e.g, to configure a new network. On failure,
+ // returns false, and leaves |onc_properties| unmodified.
+ bool ToOncProperties(base::DictionaryValue* onc_properties) const;
erikwright (departed) 2015/01/08 19:27:08 It seems a bit strange to me that you can instanti
erikwright (departed) 2015/01/08 19:27:08 Does it make sense to add properties to an existin
mukesh agrawal 2015/01/09 02:00:18 It's definitely strange. We have a bug open for th
mukesh agrawal 2015/01/09 02:00:18 Done. Thanks for the idea. I wanted to do somethi
+
// Returns a string representation of the credential, for debugging
// purposes. The string will not include the credential's passphrase.
std::string ToString() const;
@@ -47,6 +57,11 @@ class WifiCredential final { // final because the class is copyable
// ordering function plumbed in.
static CredentialSet MakeSet();
+ // Returns |ssid| as an SsidBytes instance. This convenience
+ // function simplifies some tests, which need to instantiate
+ // SsidBytes from string literals.
+ static SsidBytes MakeSsidBytes(const std::string& ssid);
stevenjb 2015/01/08 17:27:51 If this is only used for tests, append ForTest to
erikwright (departed) 2015/01/08 19:27:07 How will SsidBytes normally be constructed? What i
mukesh agrawal 2015/01/09 02:00:18 Done.
mukesh agrawal 2015/01/09 02:00:18 In the normal case, SsidBytes will be (copy-)const
erikwright (departed) 2015/01/09 14:58:20 Can you, in that case, please add a link or commen
mukesh agrawal 2015/01/09 19:00:02 Done. (Added comment about valid SSIDs.)
+
private:
// The WiFi network's SSID.
const SsidBytes ssid_;

Powered by Google App Engine
This is Rietveld 408576698