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