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

Side by Side Diff: ui/message_center/views/notification_view.h

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) 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 UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ 5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_
6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ 6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "ui/message_center/message_center_export.h" 10 #include "ui/message_center/message_center_export.h"
(...skipping 25 matching lines...) Expand all
36 // Creates appropriate MessageViews for notifications. Those currently are 36 // Creates appropriate MessageViews for notifications. Those currently are
37 // always NotificationView instances but in the future 37 // always NotificationView instances but in the future
38 // may be instances of other classes, with the class depending on the 38 // may be instances of other classes, with the class depending on the
39 // notification type. A notification is top level if it needs to be rendered 39 // notification type. A notification is top level if it needs to be rendered
40 // outside the browser window. No custom shadows are created for top level 40 // outside the browser window. No custom shadows are created for top level
41 // notifications on Linux with Aura. 41 // notifications on Linux with Aura.
42 // |controller| may be NULL, but has to be set before the view is shown. 42 // |controller| may be NULL, but has to be set before the view is shown.
43 static NotificationView* Create(MessageCenterController* controller, 43 static NotificationView* Create(MessageCenterController* controller,
44 const Notification& notification, 44 const Notification& notification,
45 bool top_level); 45 bool top_level);
46 virtual ~NotificationView(); 46 ~NotificationView() override;
47 47
48 // Overridden from views::View: 48 // Overridden from views::View:
49 virtual gfx::Size GetPreferredSize() const override; 49 gfx::Size GetPreferredSize() const override;
50 virtual int GetHeightForWidth(int width) const override; 50 int GetHeightForWidth(int width) const override;
51 virtual void Layout() override; 51 void Layout() override;
52 virtual void OnFocus() override; 52 void OnFocus() override;
53 virtual void ScrollRectToVisible(const gfx::Rect& rect) override; 53 void ScrollRectToVisible(const gfx::Rect& rect) override;
54 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; 54 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
55 55
56 // Overridden from MessageView: 56 // Overridden from MessageView:
57 virtual void UpdateWithNotification( 57 void UpdateWithNotification(const Notification& notification) override;
58 const Notification& notification) override; 58 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
59 virtual void ButtonPressed(views::Button* sender,
60 const ui::Event& event) override;
61 59
62 // Overridden from MessageViewController: 60 // Overridden from MessageViewController:
63 virtual void ClickOnNotification(const std::string& notification_id) override; 61 void ClickOnNotification(const std::string& notification_id) override;
64 virtual void RemoveNotification(const std::string& notification_id, 62 void RemoveNotification(const std::string& notification_id,
65 bool by_user) override; 63 bool by_user) override;
66 64
67 void set_controller(MessageCenterController* controller) { 65 void set_controller(MessageCenterController* controller) {
68 controller_ = controller; 66 controller_ = controller;
69 } 67 }
70 68
71 protected: 69 protected:
72 NotificationView(MessageCenterController* controller, 70 NotificationView(MessageCenterController* controller,
73 const Notification& notification); 71 const Notification& notification);
74 72
75 private: 73 private:
76 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, CreateOrUpdateTest); 74 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, CreateOrUpdateTest);
77 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, TestLineLimits); 75 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, TestLineLimits);
78 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonsStateTest); 76 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonsStateTest);
79 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonCountTest); 77 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonCountTest);
80 78
81 friend class NotificationViewTest; 79 friend class NotificationViewTest;
82 80
83 // views::ViewTargeterDelegate: 81 // views::ViewTargeterDelegate:
84 virtual views::View* TargetForRect(views::View* root, 82 views::View* TargetForRect(views::View* root, const gfx::Rect& rect) override;
85 const gfx::Rect& rect) override;
86 83
87 void CreateOrUpdateViews(const Notification& notification); 84 void CreateOrUpdateViews(const Notification& notification);
88 void SetAccessibleName(const Notification& notification); 85 void SetAccessibleName(const Notification& notification);
89 86
90 void CreateOrUpdateTitleView(const Notification& notification); 87 void CreateOrUpdateTitleView(const Notification& notification);
91 void CreateOrUpdateMessageView(const Notification& notification); 88 void CreateOrUpdateMessageView(const Notification& notification);
92 void CreateOrUpdateContextMessageView(const Notification& notification); 89 void CreateOrUpdateContextMessageView(const Notification& notification);
93 void CreateOrUpdateProgressBarView(const Notification& notification); 90 void CreateOrUpdateProgressBarView(const Notification& notification);
94 void CreateOrUpdateListItemViews(const Notification& notification); 91 void CreateOrUpdateListItemViews(const Notification& notification);
95 void CreateOrUpdateIconView(const Notification& notification); 92 void CreateOrUpdateIconView(const Notification& notification);
(...skipping 20 matching lines...) Expand all
116 views::ProgressBar* progress_bar_view_; 113 views::ProgressBar* progress_bar_view_;
117 std::vector<NotificationButton*> action_buttons_; 114 std::vector<NotificationButton*> action_buttons_;
118 std::vector<views::View*> separators_; 115 std::vector<views::View*> separators_;
119 116
120 DISALLOW_COPY_AND_ASSIGN(NotificationView); 117 DISALLOW_COPY_AND_ASSIGN(NotificationView);
121 }; 118 };
122 119
123 } // namespace message_center 120 } // namespace message_center
124 121
125 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ 122 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_button.h ('k') | ui/message_center/views/notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698