| 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 #include "ui/message_center/views/message_center_view.h" | 5 #include "ui/message_center/views/message_center_view.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const int kDefaultAnimationDurationMs = 120; | 55 const int kDefaultAnimationDurationMs = 120; |
| 56 const int kDefaultFrameRateHz = 60; | 56 const int kDefaultFrameRateHz = 60; |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 class NoNotificationMessageView : public views::View { | 59 class NoNotificationMessageView : public views::View { |
| 60 public: | 60 public: |
| 61 NoNotificationMessageView(); | 61 NoNotificationMessageView(); |
| 62 virtual ~NoNotificationMessageView(); | 62 virtual ~NoNotificationMessageView(); |
| 63 | 63 |
| 64 // Overridden from views::View. | 64 // Overridden from views::View. |
| 65 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 65 virtual gfx::Size GetPreferredSize() const override; |
| 66 virtual int GetHeightForWidth(int width) const OVERRIDE; | 66 virtual int GetHeightForWidth(int width) const override; |
| 67 virtual void Layout() OVERRIDE; | 67 virtual void Layout() override; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 views::Label* label_; | 70 views::Label* label_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(NoNotificationMessageView); | 72 DISALLOW_COPY_AND_ASSIGN(NoNotificationMessageView); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 NoNotificationMessageView::NoNotificationMessageView() { | 75 NoNotificationMessageView::NoNotificationMessageView() { |
| 76 label_ = new views::Label(l10n_util::GetStringUTF16( | 76 label_ = new views::Label(l10n_util::GetStringUTF16( |
| 77 IDS_MESSAGE_CENTER_NO_MESSAGES)); | 77 IDS_MESSAGE_CENTER_NO_MESSAGES)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 void AddNotificationAt(MessageView* view, int i); | 115 void AddNotificationAt(MessageView* view, int i); |
| 116 void RemoveNotification(MessageView* view); | 116 void RemoveNotification(MessageView* view); |
| 117 void UpdateNotification(MessageView* view, const Notification& notification); | 117 void UpdateNotification(MessageView* view, const Notification& notification); |
| 118 void SetRepositionTarget(const gfx::Rect& target_rect); | 118 void SetRepositionTarget(const gfx::Rect& target_rect); |
| 119 void ResetRepositionSession(); | 119 void ResetRepositionSession(); |
| 120 void ClearAllNotifications(const gfx::Rect& visible_scroll_rect); | 120 void ClearAllNotifications(const gfx::Rect& visible_scroll_rect); |
| 121 | 121 |
| 122 protected: | 122 protected: |
| 123 // Overridden from views::View. | 123 // Overridden from views::View. |
| 124 virtual void Layout() OVERRIDE; | 124 virtual void Layout() override; |
| 125 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 125 virtual gfx::Size GetPreferredSize() const override; |
| 126 virtual int GetHeightForWidth(int width) const OVERRIDE; | 126 virtual int GetHeightForWidth(int width) const override; |
| 127 virtual void PaintChildren(gfx::Canvas* canvas, | 127 virtual void PaintChildren(gfx::Canvas* canvas, |
| 128 const views::CullSet& cull_set) OVERRIDE; | 128 const views::CullSet& cull_set) override; |
| 129 virtual void ReorderChildLayers(ui::Layer* parent_layer) OVERRIDE; | 129 virtual void ReorderChildLayers(ui::Layer* parent_layer) override; |
| 130 | 130 |
| 131 // Overridden from views::BoundsAnimatorObserver. | 131 // Overridden from views::BoundsAnimatorObserver. |
| 132 virtual void OnBoundsAnimatorProgressed( | 132 virtual void OnBoundsAnimatorProgressed( |
| 133 views::BoundsAnimator* animator) OVERRIDE; | 133 views::BoundsAnimator* animator) override; |
| 134 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE; | 134 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override; |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 bool IsValidChild(const views::View* child) const; | 137 bool IsValidChild(const views::View* child) const; |
| 138 void DoUpdateIfPossible(); | 138 void DoUpdateIfPossible(); |
| 139 | 139 |
| 140 // Animates all notifications below target upwards to align with the top of | 140 // Animates all notifications below target upwards to align with the top of |
| 141 // the last closed notification. | 141 // the last closed notification. |
| 142 void AnimateNotificationsBelowTarget(); | 142 void AnimateNotificationsBelowTarget(); |
| 143 // Animates all notifications above target downwards to align with the top of | 143 // Animates all notifications above target downwards to align with the top of |
| 144 // the last closed notification. | 144 // the last closed notification. |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 scroller_->InvalidateLayout(); | 1001 scroller_->InvalidateLayout(); |
| 1002 PreferredSizeChanged(); | 1002 PreferredSizeChanged(); |
| 1003 Layout(); | 1003 Layout(); |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 1006 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
| 1007 message_list_view_->AddNotificationAt(view, 0); | 1007 message_list_view_->AddNotificationAt(view, 0); |
| 1008 } | 1008 } |
| 1009 | 1009 |
| 1010 } // namespace message_center | 1010 } // namespace message_center |
| OLD | NEW |