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 |
80 protected: | 82 protected: |
81 ManagedState(ManagedType type, const std::string& path); | 83 ManagedState(ManagedType type, const std::string& path); |
82 | 84 |
83 // Parses common property keys (name, type). | 85 // Parses common property keys (name, type). |
84 bool ManagedStatePropertyChanged(const std::string& key, | 86 bool ManagedStatePropertyChanged(const std::string& key, |
85 const base::Value& value); | 87 const base::Value& value); |
86 | 88 |
87 // Helper methods that log warnings and return true if parsing succeeded and | 89 // Helper methods that log warnings and return true if parsing succeeded and |
88 // the new value does not match the existing output value. | 90 // the new value does not match the existing output value. |
89 bool GetBooleanValue(const std::string& key, | 91 bool GetBooleanValue(const std::string& key, |
(...skipping 28 matching lines...) Expand all Loading... |
118 | 120 |
119 // Tracks when an update has been requested. | 121 // Tracks when an update has been requested. |
120 bool update_requested_; | 122 bool update_requested_; |
121 | 123 |
122 DISALLOW_COPY_AND_ASSIGN(ManagedState); | 124 DISALLOW_COPY_AND_ASSIGN(ManagedState); |
123 }; | 125 }; |
124 | 126 |
125 } // namespace chromeos | 127 } // namespace chromeos |
126 | 128 |
127 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ | 129 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ |
OLD | NEW |