| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const std::string& path() const { return path_; } | 72 const std::string& path() const { return path_; } |
| 73 const std::string& name() const { return name_; } | 73 const std::string& name() const { return name_; } |
| 74 const std::string& type() const { return type_; } | 74 const std::string& type() const { return type_; } |
| 75 bool update_received() const { return update_received_; } | 75 bool update_received() const { return update_received_; } |
| 76 void set_update_received() { update_received_ = true; } | 76 void set_update_received() { update_received_ = true; } |
| 77 bool update_requested() const { return update_requested_; } | 77 bool update_requested() const { return update_requested_; } |
| 78 void set_update_requested(bool update_requested) { | 78 void set_update_requested(bool update_requested) { |
| 79 update_requested_ = update_requested; | 79 update_requested_ = update_requested; |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Returns true if |type_| matches |pattern|. |
| 82 bool Matches(const NetworkTypePattern& pattern) const; | 83 bool Matches(const NetworkTypePattern& pattern) const; |
| 83 | 84 |
| 84 static std::string TypeToString(ManagedType type); | 85 static std::string TypeToString(ManagedType type); |
| 85 | 86 |
| 86 protected: | 87 protected: |
| 87 ManagedState(ManagedType type, const std::string& path); | 88 ManagedState(ManagedType type, const std::string& path); |
| 88 | 89 |
| 89 // Parses common property keys (name, type). | 90 // Parses common property keys (name, type). |
| 90 bool ManagedStatePropertyChanged(const std::string& key, | 91 bool ManagedStatePropertyChanged(const std::string& key, |
| 91 const base::Value& value); | 92 const base::Value& value); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 125 |
| 125 // Tracks when an update has been requested. | 126 // Tracks when an update has been requested. |
| 126 bool update_requested_; | 127 bool update_requested_; |
| 127 | 128 |
| 128 DISALLOW_COPY_AND_ASSIGN(ManagedState); | 129 DISALLOW_COPY_AND_ASSIGN(ManagedState); |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 } // namespace chromeos | 132 } // namespace chromeos |
| 132 | 133 |
| 133 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ | 134 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ |
| OLD | NEW |