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 ~TrayNetwork() override
;
36 tray::NetworkDetailedView
* detailed() { return detailed_
; }
39 views::View
* CreateTrayView(user::LoginStatus status
) override
;
40 views::View
* CreateDefaultView(user::LoginStatus status
) override
;
41 views::View
* CreateDetailedView(user::LoginStatus status
) override
;
42 void DestroyTrayView() override
;
43 void DestroyDefaultView() override
;
44 void DestroyDetailedView() override
;
45 void UpdateAfterLoginStatusChange(user::LoginStatus status
) override
;
46 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment
) override
;
49 void RequestToggleWifi() override
;
51 // NetworkPortalDetectorObserver
52 void OnCaptivePortalDetected(const std::string
& service_path
) override
;
54 // TrayNetworkStateObserver::Delegate
55 void NetworkStateChanged() override
;
58 tray::NetworkTrayView
* tray_
;
59 tray::NetworkDefaultView
* default_
;
60 tray::NetworkDetailedView
* detailed_
;
61 bool request_wifi_view_
;
62 scoped_ptr
<TrayNetworkStateObserver
> network_state_observer_
;
64 DISALLOW_COPY_AND_ASSIGN(TrayNetwork
);
69 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H