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