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

Unified Diff: ui/message_center/views/message_view.h

Issue 1979553003: Consolidate to use MessageView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/message_center/views/message_view.h
diff --git a/ui/message_center/views/message_view.h b/ui/message_center/views/message_view.h
index 3275b05af9b3452c5cb6b6fd26419b4d3a232b36..1ee9122abb99d261495cd77369565a3d1cf4ef46 100644
--- a/ui/message_center/views/message_view.h
+++ b/ui/message_center/views/message_view.h
@@ -32,14 +32,7 @@ class ScrollView;
namespace message_center {
-// Interface that MessageView uses to report clicks and other user actions.
-// Provided by creator of MessageView.
-class MessageViewController {
- public:
- virtual void ClickOnNotification(const std::string& notification_id) = 0;
- virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) = 0;
-};
+class MessageCenterController;
// Individual notifications constants.
const int kPaddingBetweenItems = 10;
@@ -52,7 +45,7 @@ const int kWebNotificationIconSize = 40;
class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView,
public views::ButtonListener {
public:
- MessageView(MessageViewController* controller,
+ MessageView(MessageCenterController* controller,
const std::string& notification_id,
const NotifierId& notifier_id,
const gfx::ImageSkia& small_image,
@@ -97,15 +90,20 @@ class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView,
NotifierId notifier_id() { return notifier_id_; }
const base::string16& display_source() const { return display_source_; }
+ void set_controller(MessageCenterController* controller) {
+ controller_ = controller;
+ }
+
protected:
// Overridden from views::SlideOutView:
void OnSlideOut() override;
views::ImageView* small_image() { return small_image_view_.get(); }
views::ScrollView* scroller() { return scroller_; }
+ MessageCenterController* controller() { return controller_; }
private:
- MessageViewController* controller_;
+ MessageCenterController* controller_; // Weak, lives longer then views.
std::string notification_id_;
NotifierId notifier_id_;
views::View* background_view_; // Owned by views hierarchy.

Powered by Google App Engine
This is Rietveld 408576698