Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: ui/message_center/views/message_center_view.cc

Issue 657923005: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #endif 52 #endif
53 const int kAnimateClearingNextNotificationDelayMS = 40; 53 const int kAnimateClearingNextNotificationDelayMS = 40;
54 54
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 ~NoNotificationMessageView() override;
63 63
64 // Overridden from views::View. 64 // Overridden from views::View.
65 virtual gfx::Size GetPreferredSize() const override; 65 gfx::Size GetPreferredSize() const override;
66 virtual int GetHeightForWidth(int width) const override; 66 int GetHeightForWidth(int width) const override;
67 virtual void Layout() override; 67 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 25 matching lines...) Expand all
103 } 103 }
104 104
105 // Displays a list of messages for rich notifications. Functions as an array of 105 // Displays a list of messages for rich notifications. Functions as an array of
106 // MessageViews and animates them on transitions. It also supports 106 // MessageViews and animates them on transitions. It also supports
107 // repositioning. 107 // repositioning.
108 class MessageListView : public views::View, 108 class MessageListView : public views::View,
109 public views::BoundsAnimatorObserver { 109 public views::BoundsAnimatorObserver {
110 public: 110 public:
111 explicit MessageListView(MessageCenterView* message_center_view, 111 explicit MessageListView(MessageCenterView* message_center_view,
112 bool top_down); 112 bool top_down);
113 virtual ~MessageListView(); 113 ~MessageListView() override;
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 void Layout() override;
125 virtual gfx::Size GetPreferredSize() const override; 125 gfx::Size GetPreferredSize() const override;
126 virtual int GetHeightForWidth(int width) const override; 126 int GetHeightForWidth(int width) const override;
127 virtual void PaintChildren(gfx::Canvas* canvas, 127 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 void ReorderChildLayers(ui::Layer* parent_layer) override;
130 130
131 // Overridden from views::BoundsAnimatorObserver. 131 // Overridden from views::BoundsAnimatorObserver.
132 virtual void OnBoundsAnimatorProgressed( 132 void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override;
133 views::BoundsAnimator* animator) override; 133 void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override;
134 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override;
135 134
136 private: 135 private:
137 bool IsValidChild(const views::View* child) const; 136 bool IsValidChild(const views::View* child) const;
138 void DoUpdateIfPossible(); 137 void DoUpdateIfPossible();
139 138
140 // Animates all notifications below target upwards to align with the top of 139 // Animates all notifications below target upwards to align with the top of
141 // the last closed notification. 140 // the last closed notification.
142 void AnimateNotificationsBelowTarget(); 141 void AnimateNotificationsBelowTarget();
143 // Animates all notifications above target downwards to align with the top of 142 // Animates all notifications above target downwards to align with the top of
144 // the last closed notification. 143 // the last closed notification.
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 scroller_->InvalidateLayout(); 1000 scroller_->InvalidateLayout();
1002 PreferredSizeChanged(); 1001 PreferredSizeChanged();
1003 Layout(); 1002 Layout();
1004 } 1003 }
1005 1004
1006 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { 1005 void MessageCenterView::SetNotificationViewForTest(MessageView* view) {
1007 message_list_view_->AddNotificationAt(view, 0); 1006 message_list_view_->AddNotificationAt(view, 0);
1008 } 1007 }
1009 1008
1010 } // namespace message_center 1009 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/message_center_view.h ('k') | ui/message_center/views/message_center_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698