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.
5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H
10 #include "ash/system/chromeos/network/network_observer.h"
11 #include "ash/system/chromeos/network/network_portal_detector_observer.h"
12 #include "ash/system/chromeos/network/tray_network_state_observer.h"
13 #include "ash/system/tray/system_tray_item.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/time/time.h"
23 class NetworkDefaultView
;
24 class NetworkDetailedView
;
25 class NetworkTrayView
;
28 class TrayNetwork
: public SystemTrayItem
,
29 public NetworkObserver
,
30 public NetworkPortalDetectorObserver
,
31 public TrayNetworkStateObserver::Delegate
{
33 explicit TrayNetwork(SystemTray
* system_tray
);
34 virtual ~TrayNetwork();
36 tray::NetworkDetailedView
* detailed() { return detailed_
; }
39 virtual views::View
* CreateTrayView(user::LoginStatus status
) OVERRIDE
;
40 virtual views::View
* CreateDefaultView(user::LoginStatus status
) OVERRIDE
;
41 virtual views::View
* CreateDetailedView(user::LoginStatus status
) OVERRIDE
;
42 virtual void DestroyTrayView() OVERRIDE
;
43 virtual void DestroyDefaultView() OVERRIDE
;
44 virtual void DestroyDetailedView() OVERRIDE
;
45 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status
) OVERRIDE
;
46 virtual void UpdateAfterShelfAlignmentChange(
47 ShelfAlignment alignment
) OVERRIDE
;
50 virtual void RequestToggleWifi() OVERRIDE
;
52 // NetworkPortalDetectorObserver
53 virtual void OnCaptivePortalDetected(
54 const std::string
& service_path
) OVERRIDE
;
56 // TrayNetworkStateObserver::Delegate
57 virtual void NetworkStateChanged(bool list_changed
) OVERRIDE
;
58 virtual void NetworkServiceChanged(
59 const chromeos::NetworkState
* network
) OVERRIDE
;
62 tray::NetworkTrayView
* tray_
;
63 tray::NetworkDefaultView
* default_
;
64 tray::NetworkDetailedView
* detailed_
;
65 bool request_wifi_view_
;
66 scoped_ptr
<TrayNetworkStateObserver
> network_state_observer_
;
68 DISALLOW_COPY_AND_ASSIGN(TrayNetwork
);
73 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H