- add sources.
[platform/framework/web/crosswalk.git] / src / ash / system / chromeos / network / tray_network_state_observer.h
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
3 // found in the LICENSE file.
4
5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_STATE_OBSERVER_H
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_STATE_OBSERVER_H
7
8 #include <string>
9
10 #include "base/compiler_specific.h"
11 #include "chromeos/network/network_state_handler_observer.h"
12
13 namespace ash {
14 namespace internal {
15
16 class TrayNetworkStateObserver : public chromeos::NetworkStateHandlerObserver {
17  public:
18   class Delegate {
19    public:
20     // Called when the network state may have changed. If |list_changed| is
21     // true then the list of networks may have changed.
22     virtual void NetworkStateChanged(bool list_changed) = 0;
23
24     // Called when the properties for |network| may have been updated.
25     virtual void NetworkServiceChanged(
26         const chromeos::NetworkState* network) = 0;
27
28    protected:
29     virtual ~Delegate() {}
30   };
31
32   explicit TrayNetworkStateObserver(Delegate* delegate);
33
34   virtual ~TrayNetworkStateObserver();
35
36   // NetworkStateHandlerObserver overrides.
37   virtual void NetworkListChanged() OVERRIDE;
38   virtual void DeviceListChanged() OVERRIDE;
39   virtual void DefaultNetworkChanged(
40       const chromeos::NetworkState* network) OVERRIDE;
41   virtual void NetworkPropertiesUpdated(
42       const chromeos::NetworkState* network) OVERRIDE;
43
44  private:
45   Delegate* delegate_;
46
47   DISALLOW_COPY_AND_ASSIGN(TrayNetworkStateObserver);
48 };
49
50 }  // namespace ash
51 }  // namespace internal
52
53 #endif  // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_STATE_OBSERVER_H