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_NETWORK_TRAY_NETWORK_H | 5 #ifndef ASH_SYSTEM_NETWORK_TRAY_NETWORK_H |
6 #define ASH_SYSTEM_NETWORK_TRAY_NETWORK_H | 6 #define ASH_SYSTEM_NETWORK_TRAY_NETWORK_H |
7 | 7 |
8 #include "ash/system/network/network_observer.h" | 8 #include "ash/system/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 namespace tray { | 15 namespace tray { |
16 class NetworkDefaultView; | 16 class NetworkDefaultView; |
17 class NetworkDetailedView; | 17 class NetworkDetailedView; |
18 class NetworkErrors; | 18 class NetworkErrors; |
19 class NetworkErrorView; | 19 class NetworkErrorView; |
20 class NetworkNotificationView; | 20 class NetworkNotificationView; |
21 class NetworkTrayView; | 21 class NetworkTrayView; |
22 } | 22 } |
23 | 23 |
24 class TrayNetwork : public SystemTrayItem, | 24 class TrayNetwork : public SystemTrayItem, |
25 public NetworkObserver { | 25 public NetworkObserver { |
26 public: | 26 public: |
| 27 enum DetailedViewType { |
| 28 LIST_VIEW, |
| 29 WIFI_VIEW, |
| 30 }; |
| 31 |
27 TrayNetwork(); | 32 TrayNetwork(); |
28 virtual ~TrayNetwork(); | 33 virtual ~TrayNetwork(); |
29 | 34 |
30 // Overridden from SystemTrayItem. | 35 // Overridden from SystemTrayItem. |
31 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 36 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
32 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 37 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
33 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 38 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
34 virtual views::View* CreateNotificationView( | 39 virtual views::View* CreateNotificationView( |
35 user::LoginStatus status) OVERRIDE; | 40 user::LoginStatus status) OVERRIDE; |
36 virtual void DestroyTrayView() OVERRIDE; | 41 virtual void DestroyTrayView() OVERRIDE; |
37 virtual void DestroyDefaultView() OVERRIDE; | 42 virtual void DestroyDefaultView() OVERRIDE; |
38 virtual void DestroyDetailedView() OVERRIDE; | 43 virtual void DestroyDetailedView() OVERRIDE; |
39 virtual void DestroyNotificationView() OVERRIDE; | 44 virtual void DestroyNotificationView() OVERRIDE; |
40 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 45 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
41 virtual void UpdateAfterShelfAlignmentChange( | 46 virtual void UpdateAfterShelfAlignmentChange( |
42 ShelfAlignment alignment) OVERRIDE; | 47 ShelfAlignment alignment) OVERRIDE; |
43 | 48 |
44 // Overridden from NetworkObserver. | 49 // Overridden from NetworkObserver. |
45 virtual void OnNetworkRefresh(const NetworkIconInfo& info) OVERRIDE; | 50 virtual void OnNetworkRefresh(const NetworkIconInfo& info) OVERRIDE; |
46 virtual void SetNetworkError(NetworkTrayDelegate* delegate, | 51 virtual void SetNetworkError(NetworkTrayDelegate* delegate, |
47 ErrorType error_type, | 52 ErrorType error_type, |
48 const string16& title, | 53 const string16& title, |
49 const string16& message, | 54 const string16& message, |
50 const string16& link_text) OVERRIDE; | 55 const string16& link_text) OVERRIDE; |
51 virtual void ClearNetworkError(ErrorType error_type) OVERRIDE; | 56 virtual void ClearNetworkError(ErrorType error_type) OVERRIDE; |
| 57 virtual void OnWillToggleWifi() OVERRIDE; |
52 | 58 |
53 private: | 59 private: |
54 friend class tray::NetworkErrorView; | 60 friend class tray::NetworkErrorView; |
55 friend class tray::NetworkNotificationView; | 61 friend class tray::NetworkNotificationView; |
56 | 62 |
57 void LinkClicked(ErrorType error_type); | 63 void LinkClicked(ErrorType error_type); |
58 | 64 |
59 const tray::NetworkErrors* errors() const { return errors_.get(); } | 65 const tray::NetworkErrors* errors() const { return errors_.get(); } |
60 | 66 |
61 tray::NetworkTrayView* tray_; | 67 tray::NetworkTrayView* tray_; |
62 tray::NetworkDefaultView* default_; | 68 tray::NetworkDefaultView* default_; |
63 tray::NetworkDetailedView* detailed_; | 69 tray::NetworkDetailedView* detailed_; |
64 tray::NetworkNotificationView* notification_; | 70 tray::NetworkNotificationView* notification_; |
65 scoped_ptr<tray::NetworkErrors> errors_; | 71 scoped_ptr<tray::NetworkErrors> errors_; |
| 72 bool request_wifi_view_; |
66 | 73 |
67 DISALLOW_COPY_AND_ASSIGN(TrayNetwork); | 74 DISALLOW_COPY_AND_ASSIGN(TrayNetwork); |
68 }; | 75 }; |
69 | 76 |
70 } // namespace internal | 77 } // namespace internal |
71 } // namespace ash | 78 } // namespace ash |
72 | 79 |
73 #endif // ASH_SYSTEM_NETWORK_TRAY_NETWORK_H | 80 #endif // ASH_SYSTEM_NETWORK_TRAY_NETWORK_H |
OLD | NEW |