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

Unified Diff: chromeos/network/shill_property_util.h

Issue 23551004: Move Shill property utility functions to a new separate file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 3 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
« no previous file with comments | « chromeos/network/network_state.cc ('k') | chromeos/network/shill_property_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/shill_property_util.h
diff --git a/chromeos/network/shill_property_util.h b/chromeos/network/shill_property_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..a072275c021614bbd38999f31b749903ce1a6114
--- /dev/null
+++ b/chromeos/network/shill_property_util.h
@@ -0,0 +1,56 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_
+#define CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "chromeos/chromeos_export.h"
+
+namespace base {
+class DictionaryValue;
+class Value;
+}
+
+namespace chromeos {
+
+class NetworkUIData;
+
+namespace shill_property_util {
+
+// Generates a name from properties."Wifi.HexSSID" if present, otherwise
+// validates properties.Name and returns a valid utf8 version.
+CHROMEOS_EXPORT std::string GetNameFromProperties(
+ const std::string& service_path,
+ const base::DictionaryValue& properties);
+
+// Returns the UIData specified by |value|. Returns NULL if the value cannot be
+// parsed.
+scoped_ptr<NetworkUIData> GetUIDataFromValue(const base::Value& value);
+
+// Returns the NetworkUIData parsed from the UIData property of
+// |shill_dictionary|. If parsing fails or the field doesn't exist, returns
+// NULL.
+scoped_ptr<NetworkUIData> GetUIDataFromProperties(
+ const base::DictionaryValue& shill_dictionary);
+
+// Sets the UIData property in |shill_dictionary| to the serialization of
+// |ui_data|.
+void SetUIData(const NetworkUIData& ui_data,
+ base::DictionaryValue* shill_dictionary);
+
+// Copy configuration properties required by Shill to identify a network.
+// Only WiFi, VPN, Ethernet and EthernetEAP are supported. WiMax and Cellular
+// are not supported. Returns true only if all required properties could be
+// copied.
+bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties,
+ base::DictionaryValue* dest);
+
+} // namespace shill_property_util
+
+} // namespace chromeos
+
+#endif // CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_
« no previous file with comments | « chromeos/network/network_state.cc ('k') | chromeos/network/shill_property_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698