OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ |
6 #define UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "ui/gfx/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void SetBoundsWithAnimation(gfx::Rect new_bounds); | 64 void SetBoundsWithAnimation(gfx::Rect new_bounds); |
65 | 65 |
66 // Origin and bounds are not 'instant', but rather 'current stable values', | 66 // Origin and bounds are not 'instant', but rather 'current stable values', |
67 // there could be animation in progress that targets these values. | 67 // there could be animation in progress that targets these values. |
68 gfx::Point origin() { return origin_; } | 68 gfx::Point origin() { return origin_; } |
69 gfx::Rect bounds() { return gfx::Rect(origin_, preferred_size_); } | 69 gfx::Rect bounds() { return gfx::Rect(origin_, preferred_size_); } |
70 | 70 |
71 const std::string& id() { return id_; } | 71 const std::string& id() { return id_; } |
72 | 72 |
73 // Overridden from views::View: | 73 // Overridden from views::View: |
74 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 74 virtual void OnMouseEntered(const ui::MouseEvent& event) override; |
75 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 75 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
76 virtual void Layout() OVERRIDE; | 76 virtual void Layout() override; |
77 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 77 virtual gfx::Size GetPreferredSize() const override; |
78 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 78 virtual void GetAccessibleState(ui::AXViewState* state) override; |
79 | 79 |
80 private: | 80 private: |
81 // Overridden from MessageCenterController: | 81 // Overridden from MessageCenterController: |
82 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; | 82 virtual void ClickOnNotification(const std::string& notification_id) override; |
83 virtual void RemoveNotification(const std::string& notification_id, | 83 virtual void RemoveNotification(const std::string& notification_id, |
84 bool by_user) OVERRIDE; | 84 bool by_user) override; |
85 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( | 85 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( |
86 const NotifierId& notifier_id, | 86 const NotifierId& notifier_id, |
87 const base::string16& display_source) OVERRIDE; | 87 const base::string16& display_source) override; |
88 virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE; | 88 virtual bool HasClickedListener(const std::string& notification_id) override; |
89 virtual void ClickOnNotificationButton(const std::string& notification_id, | 89 virtual void ClickOnNotificationButton(const std::string& notification_id, |
90 int button_index) OVERRIDE; | 90 int button_index) override; |
91 | 91 |
92 // Overridden from gfx::AnimationDelegate: | 92 // Overridden from gfx::AnimationDelegate: |
93 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 93 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
94 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 94 virtual void AnimationEnded(const gfx::Animation* animation) override; |
95 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; | 95 virtual void AnimationCanceled(const gfx::Animation* animation) override; |
96 | 96 |
97 // Overridden from views::WidgetDelegate: | 97 // Overridden from views::WidgetDelegate: |
98 virtual views::View* GetContentsView() OVERRIDE; | 98 virtual views::View* GetContentsView() override; |
99 virtual void WindowClosing() OVERRIDE; | 99 virtual void WindowClosing() override; |
100 virtual void OnDisplayChanged() OVERRIDE; | 100 virtual void OnDisplayChanged() override; |
101 virtual void OnWorkAreaChanged() OVERRIDE; | 101 virtual void OnWorkAreaChanged() override; |
102 | 102 |
103 // Initialization and update. | 103 // Initialization and update. |
104 void CreateWidget(gfx::NativeView parent); | 104 void CreateWidget(gfx::NativeView parent); |
105 | 105 |
106 // Immediately moves the toast without any sort of delay or animation. | 106 // Immediately moves the toast without any sort of delay or animation. |
107 void SetBoundsInstantly(gfx::Rect new_bounds); | 107 void SetBoundsInstantly(gfx::Rect new_bounds); |
108 | 108 |
109 // Given the bounds of a toast on the screen, compute the bouds for that | 109 // Given the bounds of a toast on the screen, compute the bouds for that |
110 // toast in 'closed' state. The 'closed' state is used as origin/destination | 110 // toast in 'closed' state. The 'closed' state is used as origin/destination |
111 // in reveal/closing animations. | 111 // in reveal/closing animations. |
(...skipping 22 matching lines...) Expand all Loading... |
134 | 134 |
135 gfx::Point origin_; | 135 gfx::Point origin_; |
136 gfx::Size preferred_size_; | 136 gfx::Size preferred_size_; |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(ToastContentsView); | 138 DISALLOW_COPY_AND_ASSIGN(ToastContentsView); |
139 }; | 139 }; |
140 | 140 |
141 } // namespace message_center | 141 } // namespace message_center |
142 | 142 |
143 #endif // UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ | 143 #endif // UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ |
OLD | NEW |