| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class Value; | 15 class Value; |
| 16 class DictionaryValue; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| 20 class DeviceState; | 21 class DeviceState; |
| 21 class FavoriteState; | 22 class FavoriteState; |
| 22 class NetworkState; | 23 class NetworkState; |
| 23 | 24 |
| 24 // Base class for states managed by NetworkStateManger which are associated | 25 // Base class for states managed by NetworkStateManger which are associated |
| 25 // with a Shill path (e.g. service path or device path). | 26 // with a Shill path (e.g. service path or device path). |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 // then the state wasn't modified. This might happen because of | 50 // then the state wasn't modified. This might happen because of |
| 50 // * |key| was not recognized. | 51 // * |key| was not recognized. |
| 51 // * |value| was not parsed successfully. | 52 // * |value| was not parsed successfully. |
| 52 // * |value| is equal to the cached property value. | 53 // * |value| is equal to the cached property value. |
| 53 // If the return value is true, the state might or might not be modified. | 54 // If the return value is true, the state might or might not be modified. |
| 54 virtual bool PropertyChanged(const std::string& key, | 55 virtual bool PropertyChanged(const std::string& key, |
| 55 const base::Value& value) = 0; | 56 const base::Value& value) = 0; |
| 56 | 57 |
| 57 // Called by NetworkStateHandler after all calls to PropertyChanged for the | 58 // Called by NetworkStateHandler after all calls to PropertyChanged for the |
| 58 // initial set of properties. Used to update state requiring multiple | 59 // initial set of properties. Used to update state requiring multiple |
| 59 // parsed properties, e.g. name from hex_ssid in NetworkState. | 60 // properties, e.g. name from hex_ssid in NetworkState. |
| 60 virtual void InitialPropertiesReceived(); | 61 // |properties| contains the complete set of initial properties. |
| 62 // Returns true if any additional properties are updated. |
| 63 virtual bool InitialPropertiesReceived( |
| 64 const base::DictionaryValue& properties); |
| 61 | 65 |
| 62 const ManagedType managed_type() const { return managed_type_; } | 66 const ManagedType managed_type() const { return managed_type_; } |
| 63 const std::string& path() const { return path_; } | 67 const std::string& path() const { return path_; } |
| 64 const std::string& name() const { return name_; } | 68 const std::string& name() const { return name_; } |
| 65 const std::string& type() const { return type_; } | 69 const std::string& type() const { return type_; } |
| 66 bool update_requested() const { return update_requested_; } | 70 bool update_requested() const { return update_requested_; } |
| 67 void set_update_requested(bool update_requested) { | 71 void set_update_requested(bool update_requested) { |
| 68 update_requested_ = update_requested; | 72 update_requested_ = update_requested; |
| 69 } | 73 } |
| 70 | 74 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 110 |
| 107 // Tracks when an update has been requested. | 111 // Tracks when an update has been requested. |
| 108 bool update_requested_; | 112 bool update_requested_; |
| 109 | 113 |
| 110 DISALLOW_COPY_AND_ASSIGN(ManagedState); | 114 DISALLOW_COPY_AND_ASSIGN(ManagedState); |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 } // namespace chromeos | 117 } // namespace chromeos |
| 114 | 118 |
| 115 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ | 119 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ |
| OLD | NEW |