Chromium Code Reviews| Index: chromeos/network/network_state_handler_observer.h |
| diff --git a/chromeos/network/network_state_handler_observer.h b/chromeos/network/network_state_handler_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f73f0285a0892fe969e25884304b21d65bea8a73 |
| --- /dev/null |
| +++ b/chromeos/network/network_state_handler_observer.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_OBSERVER_H_ |
| +#define CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_OBSERVER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| +#include "base/basictypes.h" |
|
gauravsh
2012/10/25 23:41:05
NIT: new line before this.
stevenjb
2012/10/26 21:36:39
Done.
|
| +#include "chromeos/chromeos_export.h" |
| + |
| +namespace chromeos { |
| + |
| +class NetworkState; |
| + |
| +// Observer class for all network state changes, including changes to |
| +// active (connecting or connected) services. |
| +class CHROMEOS_EXPORT NetworkStateHandlerObserver { |
| + public: |
| + typedef std::vector<NetworkState*> NetworkStateList; |
| + |
| + NetworkStateHandlerObserver(); |
| + virtual ~NetworkStateHandlerObserver(); |
| + |
| + // If |property| is non empty than that property has changed. Otherwise |
|
gauravsh
2012/10/25 23:41:05
empty than -> empty, then
stevenjb
2012/10/26 21:36:39
Done.
|
| + // we received a complete update so multiple properties may have changed. |
| + virtual void NetworkManagerChanged(const std::string& property); |
| + // The list of networks changed. |
| + virtual void NetworkListChanged(const NetworkStateList& networks); |
|
gauravsh
2012/10/25 23:41:05
Suggest adding new lines to split declarations - e
stevenjb
2012/10/26 21:36:39
Done.
|
| + // The active network changed. |network| will be NULL if there is no longer |
| + // an active network. |
| + virtual void ActiveNetworkChanged(const NetworkState* network); |
| + // The state of the active network changed. |
| + virtual void ActiveNetworkStateChanged(const NetworkState* network); |
| + // A network service property changed. |property| is the name of the changed |
| + // property (from service_constants.h). Note: for the active network, |
| + // this will be called in *addition* to ActiveNetworkStateChanged() if |
| + // property == flimflam::kStateProperty. |
| + virtual void NetworkServicePropertyChanged(const NetworkState* network, |
| + const std::string& property); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(NetworkStateHandlerObserver); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_OBSERVER_H_ |