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

Side by Side Diff: trunk/src/chromeos/network/managed_state.h

Issue 15954007: Revert 202478 "Revert 202388 "Remove NetworkStateInformer's depe..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 22 matching lines...) Expand all
33 33
34 // This will construct and return a new instance of the appropriate class 34 // This will construct and return a new instance of the appropriate class
35 // based on |type|. 35 // based on |type|.
36 static ManagedState* Create(ManagedType type, const std::string& path); 36 static ManagedState* Create(ManagedType type, const std::string& path);
37 37
38 // Returns the specific class pointer if this is the correct type, or 38 // Returns the specific class pointer if this is the correct type, or
39 // NULL if it is not. 39 // NULL if it is not.
40 NetworkState* AsNetworkState(); 40 NetworkState* AsNetworkState();
41 DeviceState* AsDeviceState(); 41 DeviceState* AsDeviceState();
42 42
43 // Called by NetworkStateHandler when a property changes. Returns false if 43 // Called by NetworkStateHandler when a property was received. The return
44 // the property was not recognized, was not parsed successfully, or is 44 // value indicates if the state changed and is used to reduce the number of
45 // unchanged (complex properties may be assumed to have changed). 45 // notifications. The only guarantee however is: If the return value is false
46 // then the state wasn't modified. This might happen because of
47 // * |key| was not recognized.
48 // * |value| was not parsed successfully.
49 // * |value| is equal to the cached property value.
50 // If the return value is true, the state might or might not be modified.
46 virtual bool PropertyChanged(const std::string& key, 51 virtual bool PropertyChanged(const std::string& key,
47 const base::Value& value) = 0; 52 const base::Value& value) = 0;
48 53
49 // Called by NetworkStateHandler after all calls to PropertyChanged for the 54 // Called by NetworkStateHandler after all calls to PropertyChanged for the
50 // initial set of properties. Used to update state requiring multiple 55 // initial set of properties. Used to update state requiring multiple
51 // parsed properties, e.g. name from hex_ssid in NetworkState. 56 // parsed properties, e.g. name from hex_ssid in NetworkState.
52 virtual void InitialPropertiesReceived(); 57 virtual void InitialPropertiesReceived();
53 58
54 const ManagedType managed_type() const { return managed_type_; } 59 const ManagedType managed_type() const { return managed_type_; }
55 const std::string& path() const { return path_; } 60 const std::string& path() const { return path_; }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 105
101 // Tracks when an update has been requested. 106 // Tracks when an update has been requested.
102 bool update_requested_; 107 bool update_requested_;
103 108
104 DISALLOW_COPY_AND_ASSIGN(ManagedState); 109 DISALLOW_COPY_AND_ASSIGN(ManagedState);
105 }; 110 };
106 111
107 } // namespace chromeos 112 } // namespace chromeos
108 113
109 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ 114 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc ('k') | trunk/src/chromeos/network/network_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698