OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_NETWORK_MANAGED_STATE_H_ | 5 #ifndef CHROMEOS_NETWORK_MANAGED_STATE_H_ |
6 #define CHROMEOS_NETWORK_MANAGED_STATE_H_ | 6 #define CHROMEOS_NETWORK_MANAGED_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 const std::string& type() const { return type_; } | 70 const std::string& type() const { return type_; } |
71 bool update_received() const { return update_received_; } | 71 bool update_received() const { return update_received_; } |
72 void set_update_received() { update_received_ = true; } | 72 void set_update_received() { update_received_ = true; } |
73 bool update_requested() const { return update_requested_; } | 73 bool update_requested() const { return update_requested_; } |
74 void set_update_requested(bool update_requested) { | 74 void set_update_requested(bool update_requested) { |
75 update_requested_ = update_requested; | 75 update_requested_ = update_requested; |
76 } | 76 } |
77 | 77 |
78 bool Matches(const NetworkTypePattern& pattern) const; | 78 bool Matches(const NetworkTypePattern& pattern) const; |
79 | 79 |
80 static std::string TypeToString(ManagedType type); | |
81 | |
82 protected: | 80 protected: |
83 ManagedState(ManagedType type, const std::string& path); | 81 ManagedState(ManagedType type, const std::string& path); |
84 | 82 |
85 // Parses common property keys (name, type). | 83 // Parses common property keys (name, type). |
86 bool ManagedStatePropertyChanged(const std::string& key, | 84 bool ManagedStatePropertyChanged(const std::string& key, |
87 const base::Value& value); | 85 const base::Value& value); |
88 | 86 |
89 // Helper methods that log warnings and return true if parsing succeeded and | 87 // Helper methods that log warnings and return true if parsing succeeded and |
90 // the new value does not match the existing output value. | 88 // the new value does not match the existing output value. |
91 bool GetBooleanValue(const std::string& key, | 89 bool GetBooleanValue(const std::string& key, |
(...skipping 28 matching lines...) Expand all Loading... |
120 | 118 |
121 // Tracks when an update has been requested. | 119 // Tracks when an update has been requested. |
122 bool update_requested_; | 120 bool update_requested_; |
123 | 121 |
124 DISALLOW_COPY_AND_ASSIGN(ManagedState); | 122 DISALLOW_COPY_AND_ASSIGN(ManagedState); |
125 }; | 123 }; |
126 | 124 |
127 } // namespace chromeos | 125 } // namespace chromeos |
128 | 126 |
129 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ | 127 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ |
OLD | NEW |