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

Unified Diff: chrome/browser/chromeos/cros/network_property_ui_data.h

Issue 13454006: Moving ManagedNetworkConfigurationHandler to chromeos/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up parsing of NetworkUIData. Created 7 years, 8 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: chrome/browser/chromeos/cros/network_property_ui_data.h
diff --git a/chrome/browser/chromeos/cros/network_ui_data.h b/chrome/browser/chromeos/cros/network_property_ui_data.h
similarity index 42%
copy from chrome/browser/chromeos/cros/network_ui_data.h
copy to chrome/browser/chromeos/cros/network_property_ui_data.h
index aa16974d9cbbeeb3fb13767b0f7a07b64c6b498b..d905a407c46932152851da159861c37d80e03063 100644
--- a/chrome/browser/chromeos/cros/network_ui_data.h
+++ b/chrome/browser/chromeos/cros/network_property_ui_data.h
@@ -2,84 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_UI_DATA_H_
-#define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_UI_DATA_H_
+#ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PROPERTY_UI_DATA_H_
+#define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PROPERTY_UI_DATA_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "base/values.h"
-#include "chrome/browser/chromeos/cros/certificate_pattern.h"
-#include "chrome/browser/chromeos/cros/enum_mapper.h"
-#include "chrome/browser/chromeos/cros/network_constants.h"
-#include "chromeos/network/onc/onc_constants.h"
-namespace chromeos {
-
-class NetworkPropertyUIData;
-
-// Helper for accessing and setting values in the network's UI data dictionary.
-// Accessing values is done via static members that take the network as an
-// argument. In order to fill a UI data dictionary, construct an instance, set
-// up your data members, and call FillDictionary(). For example, if you have a
-// |network|:
-//
-// NetworkUIData ui_data;
-// ui_data.set_onc_source(onc::ONC_SOURCE_USER_IMPORT);
-// ui_data.FillDictionary(network->ui_data());
-class NetworkUIData {
- public:
- NetworkUIData();
- explicit NetworkUIData(const base::DictionaryValue& dict);
- ~NetworkUIData();
-
- void set_onc_source(onc::ONCSource onc_source) { onc_source_ = onc_source; }
- onc::ONCSource onc_source() const { return onc_source_; }
-
- void set_certificate_pattern(const CertificatePattern& pattern) {
- certificate_pattern_ = pattern;
- }
- const CertificatePattern& certificate_pattern() const {
- return certificate_pattern_;
- }
- void set_certificate_type(ClientCertType type) {
- certificate_type_ = type;
- }
- ClientCertType certificate_type() const {
- return certificate_type_;
- }
- bool is_managed() const {
- return onc_source_ == onc::ONC_SOURCE_DEVICE_POLICY ||
- onc_source_ == onc::ONC_SOURCE_USER_POLICY;
- }
-
- // Fills in |dict| with the currently configured values. This will write the
- // keys appropriate for Network::ui_data() as defined below (kKeyXXX).
- void FillDictionary(base::DictionaryValue* dict) const;
-
- // Key for storing source of the ONC network, which is an integer according to
- // enum ONCSource.
- static const char kKeyONCSource[];
-
- // Key for storing certificate pattern for this network (if any).
- static const char kKeyCertificatePattern[];
-
- // Key for storing certificate type for this network (if any), which is one of
- // "pattern", "ref", or "none", according to ClientCertType.
- static const char kKeyCertificateType[];
+namespace base {
+class DictionaryValue;
+class Value;
+}
- private:
- static EnumMapper<onc::ONCSource>& GetONCSourceMapper();
- static EnumMapper<ClientCertType>& GetClientCertMapper();
-
- CertificatePattern certificate_pattern_;
- onc::ONCSource onc_source_;
- ClientCertType certificate_type_;
+namespace chromeos {
- static const EnumMapper<onc::ONCSource>::Pair kONCSourceTable[];
- static const EnumMapper<ClientCertType>::Pair kClientCertTable[];
-};
+class NetworkUIData;
// Holds meta information for a network property: Whether the property is under
// policy control, if it is user-editable, and whether the policy-provided
@@ -133,4 +71,4 @@ class NetworkPropertyUIData {
} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_UI_DATA_H_
+#endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PROPERTY_UI_DATA_H_
« no previous file with comments | « chrome/browser/chromeos/cros/network_library_impl_base.cc ('k') | chrome/browser/chromeos/cros/network_property_ui_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698