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_TRAY_TRAY_NOTIFICATION_VIEW_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_NOTIFICATION_VIEW_H_ |
6 #define ASH_SYSTEM_TRAY_TRAY_NOTIFICATION_VIEW_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_NOTIFICATION_VIEW_H_ |
7 | 7 |
8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
9 #include "ui/views/controls/button/image_button.h" | 9 #include "ui/views/controls/button/image_button.h" |
10 #include "ui/views/controls/slide_out_view.h" | 10 #include "ui/views/controls/slide_out_view.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void UpdateViewAndImage(views::View* new_contents, | 49 void UpdateViewAndImage(views::View* new_contents, |
50 const gfx::ImageSkia& image); | 50 const gfx::ImageSkia& image); |
51 | 51 |
52 // Autoclose timer operations. | 52 // Autoclose timer operations. |
53 void StartAutoCloseTimer(int seconds); | 53 void StartAutoCloseTimer(int seconds); |
54 void StopAutoCloseTimer(); | 54 void StopAutoCloseTimer(); |
55 void RestartAutoCloseTimer(); | 55 void RestartAutoCloseTimer(); |
56 | 56 |
57 // Overridden from ButtonListener. | 57 // Overridden from ButtonListener. |
58 virtual void ButtonPressed(views::Button* sender, | 58 virtual void ButtonPressed(views::Button* sender, |
59 const ui::Event& event) OVERRIDE; | 59 const ui::Event& event) override; |
60 | 60 |
61 // Overridden from views::View. | 61 // Overridden from views::View. |
62 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 62 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
63 | 63 |
64 // Overridden from ui::EventHandler. | 64 // Overridden from ui::EventHandler. |
65 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 65 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
66 | 66 |
67 protected: | 67 protected: |
68 // Called when the close button is pressed. Does nothing by default. | 68 // Called when the close button is pressed. Does nothing by default. |
69 virtual void OnClose(); | 69 virtual void OnClose(); |
70 // Called when the notification is clicked on. Does nothing by default. | 70 // Called when the notification is clicked on. Does nothing by default. |
71 virtual void OnClickAction(); | 71 virtual void OnClickAction(); |
72 | 72 |
73 // Overridden from views::SlideOutView. | 73 // Overridden from views::SlideOutView. |
74 virtual void OnSlideOut() OVERRIDE; | 74 virtual void OnSlideOut() override; |
75 | 75 |
76 SystemTrayItem* owner() { return owner_; } | 76 SystemTrayItem* owner() { return owner_; } |
77 | 77 |
78 private: | 78 private: |
79 void HandleClose(); | 79 void HandleClose(); |
80 void HandleClickAction(); | 80 void HandleClickAction(); |
81 | 81 |
82 SystemTrayItem* owner_; | 82 SystemTrayItem* owner_; |
83 int icon_id_; | 83 int icon_id_; |
84 views::ImageView* icon_; | 84 views::ImageView* icon_; |
85 | 85 |
86 int autoclose_delay_; | 86 int autoclose_delay_; |
87 base::OneShotTimer<TrayNotificationView> autoclose_; | 87 base::OneShotTimer<TrayNotificationView> autoclose_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(TrayNotificationView); | 89 DISALLOW_COPY_AND_ASSIGN(TrayNotificationView); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace ash | 92 } // namespace ash |
93 | 93 |
94 #endif // ASH_SYSTEM_TRAY_TRAY_NOTIFICATION_VIEW_H_ | 94 #endif // ASH_SYSTEM_TRAY_TRAY_NOTIFICATION_VIEW_H_ |
OLD | NEW |