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