OLD | NEW |
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 ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H | 5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H |
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H | 6 #define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/system/chromeos/network/network_icon.h" | 10 #include "ash/system/chromeos/network/network_icon.h" |
11 #include "ash/system/chromeos/network/network_observer.h" | 11 #include "ash/system/chromeos/network/network_observer.h" |
12 #include "ash/system/chromeos/network/tray_network_state_observer.h" | 12 #include "ash/system/chromeos/network/tray_network_state_observer.h" |
13 #include "ash/system/tray/system_tray_item.h" | 13 #include "ash/system/tray/system_tray_item.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 | 16 |
17 namespace chromeos { | 17 namespace chromeos { |
18 class NetworkState; | 18 class NetworkState; |
19 } | 19 } |
20 | 20 |
21 namespace ash { | 21 namespace ash { |
22 namespace internal { | 22 namespace internal { |
23 | 23 |
24 namespace tray { | 24 namespace tray { |
25 class NetworkDefaultView; | 25 class NetworkDefaultView; |
26 class NetworkDetailedView; | 26 class NetworkDetailedView; |
27 class NetworkMessages; | |
28 class NetworkMessageView; | |
29 class NetworkNotificationView; | |
30 class NetworkTrayView; | 27 class NetworkTrayView; |
31 } | 28 } |
32 | 29 |
33 class TrayNetwork : public SystemTrayItem, | 30 class TrayNetwork : public SystemTrayItem, |
34 public NetworkObserver, | 31 public NetworkObserver, |
35 public TrayNetworkStateObserver::Delegate { | 32 public TrayNetworkStateObserver::Delegate { |
36 public: | 33 public: |
37 explicit TrayNetwork(SystemTray* system_tray); | 34 explicit TrayNetwork(SystemTray* system_tray); |
38 virtual ~TrayNetwork(); | 35 virtual ~TrayNetwork(); |
39 | 36 |
40 tray::NetworkDetailedView* detailed() { return detailed_; } | 37 tray::NetworkDetailedView* detailed() { return detailed_; } |
41 | 38 |
42 // SystemTrayItem | 39 // SystemTrayItem |
43 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 40 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
44 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 41 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
45 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 42 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
46 virtual views::View* CreateNotificationView( | |
47 user::LoginStatus status) OVERRIDE; | |
48 virtual void DestroyTrayView() OVERRIDE; | 43 virtual void DestroyTrayView() OVERRIDE; |
49 virtual void DestroyDefaultView() OVERRIDE; | 44 virtual void DestroyDefaultView() OVERRIDE; |
50 virtual void DestroyDetailedView() OVERRIDE; | 45 virtual void DestroyDetailedView() OVERRIDE; |
51 virtual void DestroyNotificationView() OVERRIDE; | |
52 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 46 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
53 virtual void UpdateAfterShelfAlignmentChange( | 47 virtual void UpdateAfterShelfAlignmentChange( |
54 ShelfAlignment alignment) OVERRIDE; | 48 ShelfAlignment alignment) OVERRIDE; |
55 | 49 |
56 // NetworkObserver | 50 // NetworkObserver |
57 virtual void SetNetworkMessage( | |
58 NetworkTrayDelegate* delegate, | |
59 MessageType message_type, | |
60 NetworkType network_type, | |
61 const base::string16& title, | |
62 const base::string16& message, | |
63 const std::vector<base::string16>& links) OVERRIDE; | |
64 virtual void ClearNetworkMessage(MessageType message_type) OVERRIDE; | |
65 virtual void RequestToggleWifi() OVERRIDE; | 51 virtual void RequestToggleWifi() OVERRIDE; |
66 | 52 |
67 // TrayNetworkStateObserver::Delegate | 53 // TrayNetworkStateObserver::Delegate |
68 virtual void NetworkStateChanged(bool list_changed) OVERRIDE; | 54 virtual void NetworkStateChanged(bool list_changed) OVERRIDE; |
69 virtual void NetworkServiceChanged( | 55 virtual void NetworkServiceChanged( |
70 const chromeos::NetworkState* network) OVERRIDE; | 56 const chromeos::NetworkState* network) OVERRIDE; |
71 | 57 |
72 private: | 58 private: |
73 friend class tray::NetworkMessageView; | |
74 friend class tray::NetworkNotificationView; | |
75 | |
76 void LinkClicked(MessageType message_type, int link_id); | |
77 | |
78 const tray::NetworkMessages* messages() const { return messages_.get(); } | |
79 | |
80 tray::NetworkTrayView* tray_; | 59 tray::NetworkTrayView* tray_; |
81 tray::NetworkDefaultView* default_; | 60 tray::NetworkDefaultView* default_; |
82 tray::NetworkDetailedView* detailed_; | 61 tray::NetworkDetailedView* detailed_; |
83 tray::NetworkNotificationView* notification_; | |
84 scoped_ptr<tray::NetworkMessages> messages_; | |
85 bool request_wifi_view_; | 62 bool request_wifi_view_; |
86 scoped_ptr<TrayNetworkStateObserver> network_state_observer_; | 63 scoped_ptr<TrayNetworkStateObserver> network_state_observer_; |
87 | 64 |
88 DISALLOW_COPY_AND_ASSIGN(TrayNetwork); | 65 DISALLOW_COPY_AND_ASSIGN(TrayNetwork); |
89 }; | 66 }; |
90 | 67 |
91 } // namespace internal | 68 } // namespace internal |
92 } // namespace ash | 69 } // namespace ash |
93 | 70 |
94 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H | 71 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H |
OLD | NEW |