| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void OnMouseExited(const ui::MouseEvent& event) override; | 76 void OnMouseExited(const ui::MouseEvent& event) override; |
| 77 void Layout() override; | 77 void Layout() override; |
| 78 gfx::Size GetPreferredSize() const override; | 78 gfx::Size GetPreferredSize() const override; |
| 79 void GetAccessibleState(ui::AXViewState* state) override; | 79 void GetAccessibleState(ui::AXViewState* state) override; |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 // Overridden from MessageCenterController: | 82 // Overridden from MessageCenterController: |
| 83 void ClickOnNotification(const std::string& notification_id) override; | 83 void ClickOnNotification(const std::string& notification_id) override; |
| 84 void RemoveNotification(const std::string& notification_id, | 84 void RemoveNotification(const std::string& notification_id, |
| 85 bool by_user) override; | 85 bool by_user) override; |
| 86 scoped_ptr<ui::MenuModel> CreateMenuModel( | 86 std::unique_ptr<ui::MenuModel> CreateMenuModel( |
| 87 const NotifierId& notifier_id, | 87 const NotifierId& notifier_id, |
| 88 const base::string16& display_source) override; | 88 const base::string16& display_source) override; |
| 89 bool HasClickedListener(const std::string& notification_id) override; | 89 bool HasClickedListener(const std::string& notification_id) override; |
| 90 void ClickOnNotificationButton(const std::string& notification_id, | 90 void ClickOnNotificationButton(const std::string& notification_id, |
| 91 int button_index) override; | 91 int button_index) override; |
| 92 void ClickOnSettingsButton(const std::string& notification_id) override; | 92 void ClickOnSettingsButton(const std::string& notification_id) override; |
| 93 | 93 |
| 94 // Overridden from gfx::AnimationDelegate: | 94 // Overridden from gfx::AnimationDelegate: |
| 95 void AnimationProgressed(const gfx::Animation* animation) override; | 95 void AnimationProgressed(const gfx::Animation* animation) override; |
| 96 void AnimationEnded(const gfx::Animation* animation) override; | 96 void AnimationEnded(const gfx::Animation* animation) override; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 115 | 115 |
| 116 void StartFadeIn(); | 116 void StartFadeIn(); |
| 117 void StartFadeOut(); // Will call Widget::Close() when animation ends. | 117 void StartFadeOut(); // Will call Widget::Close() when animation ends. |
| 118 void OnBoundsAnimationEndedOrCancelled(const gfx::Animation* animation); | 118 void OnBoundsAnimationEndedOrCancelled(const gfx::Animation* animation); |
| 119 | 119 |
| 120 base::WeakPtr<MessagePopupCollection> collection_; | 120 base::WeakPtr<MessagePopupCollection> collection_; |
| 121 | 121 |
| 122 // Id if the corresponding Notification. | 122 // Id if the corresponding Notification. |
| 123 std::string id_; | 123 std::string id_; |
| 124 | 124 |
| 125 scoped_ptr<gfx::SlideAnimation> bounds_animation_; | 125 std::unique_ptr<gfx::SlideAnimation> bounds_animation_; |
| 126 scoped_ptr<gfx::SlideAnimation> fade_animation_; | 126 std::unique_ptr<gfx::SlideAnimation> fade_animation_; |
| 127 | 127 |
| 128 gfx::Rect animated_bounds_start_; | 128 gfx::Rect animated_bounds_start_; |
| 129 gfx::Rect animated_bounds_end_; | 129 gfx::Rect animated_bounds_end_; |
| 130 // Started closing animation, will close at the end. | 130 // Started closing animation, will close at the end. |
| 131 bool is_closing_; | 131 bool is_closing_; |
| 132 // Closing animation - when it ends, close the widget. Weak, only used | 132 // Closing animation - when it ends, close the widget. Weak, only used |
| 133 // for referential equality. | 133 // for referential equality. |
| 134 gfx::Animation* closing_animation_; | 134 gfx::Animation* closing_animation_; |
| 135 | 135 |
| 136 gfx::Point origin_; | 136 gfx::Point origin_; |
| 137 gfx::Size preferred_size_; | 137 gfx::Size preferred_size_; |
| 138 | 138 |
| 139 DISALLOW_COPY_AND_ASSIGN(ToastContentsView); | 139 DISALLOW_COPY_AND_ASSIGN(ToastContentsView); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace message_center | 142 } // namespace message_center |
| 143 | 143 |
| 144 #endif // UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ | 144 #endif // UI_MESSAGE_CENTER_VIEWS_TOAST_CONTENTS_VIEW_H_ |
| OLD | NEW |