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 "ash/system/chromeos/network/network_observer.h" | 8 #include "ash/system/chromeos/network/network_observer.h" |
9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 | 11 |
12 namespace ash { | 12 namespace ash { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
| 15 class TrayNetworkStateObserver; |
| 16 |
15 namespace tray { | 17 namespace tray { |
16 class NetworkDefaultView; | 18 class NetworkDefaultView; |
17 class NetworkDetailedView; | 19 class NetworkDetailedView; |
18 class NetworkMessages; | 20 class NetworkMessages; |
19 class NetworkMessageView; | 21 class NetworkMessageView; |
20 class NetworkNotificationView; | 22 class NetworkNotificationView; |
21 class NetworkTrayView; | 23 class NetworkTrayView; |
22 } | 24 } |
23 | 25 |
24 class TrayNetwork : public SystemTrayItem, | 26 class TrayNetwork : public SystemTrayItem, |
25 public NetworkObserver { | 27 public NetworkObserver { |
26 public: | 28 public: |
27 enum DetailedViewType { | |
28 LIST_VIEW, | |
29 WIFI_VIEW, | |
30 }; | |
31 | |
32 explicit TrayNetwork(SystemTray* system_tray); | 29 explicit TrayNetwork(SystemTray* system_tray); |
33 virtual ~TrayNetwork(); | 30 virtual ~TrayNetwork(); |
34 | 31 |
| 32 tray::NetworkDetailedView* detailed() { return detailed_; } |
| 33 void set_request_wifi_view(bool b) { request_wifi_view_ = b; } |
| 34 |
35 // Overridden from SystemTrayItem. | 35 // Overridden from SystemTrayItem. |
36 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 36 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
37 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 37 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
38 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 38 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
39 virtual views::View* CreateNotificationView( | 39 virtual views::View* CreateNotificationView( |
40 user::LoginStatus status) OVERRIDE; | 40 user::LoginStatus status) OVERRIDE; |
41 virtual void DestroyTrayView() OVERRIDE; | 41 virtual void DestroyTrayView() OVERRIDE; |
42 virtual void DestroyDefaultView() OVERRIDE; | 42 virtual void DestroyDefaultView() OVERRIDE; |
43 virtual void DestroyDetailedView() OVERRIDE; | 43 virtual void DestroyDetailedView() OVERRIDE; |
44 virtual void DestroyNotificationView() OVERRIDE; | 44 virtual void DestroyNotificationView() OVERRIDE; |
(...skipping 19 matching lines...) Expand all Loading... |
64 void LinkClicked(MessageType message_type, int link_id); | 64 void LinkClicked(MessageType message_type, int link_id); |
65 | 65 |
66 const tray::NetworkMessages* messages() const { return messages_.get(); } | 66 const tray::NetworkMessages* messages() const { return messages_.get(); } |
67 | 67 |
68 tray::NetworkTrayView* tray_; | 68 tray::NetworkTrayView* tray_; |
69 tray::NetworkDefaultView* default_; | 69 tray::NetworkDefaultView* default_; |
70 tray::NetworkDetailedView* detailed_; | 70 tray::NetworkDetailedView* detailed_; |
71 tray::NetworkNotificationView* notification_; | 71 tray::NetworkNotificationView* notification_; |
72 scoped_ptr<tray::NetworkMessages> messages_; | 72 scoped_ptr<tray::NetworkMessages> messages_; |
73 bool request_wifi_view_; | 73 bool request_wifi_view_; |
| 74 scoped_ptr<TrayNetworkStateObserver> network_state_observer_; |
74 | 75 |
75 DISALLOW_COPY_AND_ASSIGN(TrayNetwork); | 76 DISALLOW_COPY_AND_ASSIGN(TrayNetwork); |
76 }; | 77 }; |
77 | 78 |
78 } // namespace internal | 79 } // namespace internal |
79 } // namespace ash | 80 } // namespace ash |
80 | 81 |
81 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H | 82 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H |
OLD | NEW |