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

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

Issue 1979583003: Support notifications with custom content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@messageview-close-button
Patch Set: fix mac build, attempt 2 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 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_MESSAGE_VIEW_H_ 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 protected: 94 protected:
95 // Overridden from views::SlideOutView: 95 // Overridden from views::SlideOutView:
96 void OnSlideOut() override; 96 void OnSlideOut() override;
97 97
98 // Creates and add close button to view hierarchy when necessary. Derived 98 // Creates and add close button to view hierarchy when necessary. Derived
99 // classes should call this after its view hierarchy is populated to ensure 99 // classes should call this after its view hierarchy is populated to ensure
100 // it is on top of other views. 100 // it is on top of other views.
101 void CreateOrUpdateCloseButtonView(const Notification& notification); 101 void CreateOrUpdateCloseButtonView(const Notification& notification);
102 102
103 // Changes the background color being used by |background_view_| and schedules
104 // a paint.
105 virtual void SetDrawBackgroundAsActive(bool active);
106
107 views::View* background_view() { return background_view_; }
103 views::ImageView* small_image() { return small_image_view_.get(); } 108 views::ImageView* small_image() { return small_image_view_.get(); }
104 views::ImageButton* close_button() { return close_button_.get(); } 109 views::ImageButton* close_button() { return close_button_.get(); }
105 views::ScrollView* scroller() { return scroller_; } 110 views::ScrollView* scroller() { return scroller_; }
106 MessageCenterController* controller() { return controller_; } 111 MessageCenterController* controller() { return controller_; }
107 112
108 private: 113 private:
109 // Changes the background color being used by |background_view_| and schedules
110 // a paint.
111 void SetDrawBackgroundAsActive(bool active);
112
113 MessageCenterController* controller_; // Weak, lives longer then views. 114 MessageCenterController* controller_; // Weak, lives longer then views.
114 std::string notification_id_; 115 std::string notification_id_;
115 NotifierId notifier_id_; 116 NotifierId notifier_id_;
116 views::View* background_view_ = nullptr; // Owned by views hierarchy. 117 views::View* background_view_ = nullptr; // Owned by views hierarchy.
117 std::unique_ptr<views::ImageView> small_image_view_; 118 std::unique_ptr<views::ImageView> small_image_view_;
118 std::unique_ptr<views::ImageButton> close_button_; 119 std::unique_ptr<views::ImageButton> close_button_;
119 views::ScrollView* scroller_ = nullptr; 120 views::ScrollView* scroller_ = nullptr;
120 121
121 base::string16 accessible_name_; 122 base::string16 accessible_name_;
122 123
123 base::string16 display_source_; 124 base::string16 display_source_;
124 125
125 std::unique_ptr<views::Painter> focus_painter_; 126 std::unique_ptr<views::Painter> focus_painter_;
126 127
127 DISALLOW_COPY_AND_ASSIGN(MessageView); 128 DISALLOW_COPY_AND_ASSIGN(MessageView);
128 }; 129 };
129 130
130 } // namespace message_center 131 } // namespace message_center
131 132
132 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ 133 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_
OLDNEW
« no previous file with comments | « ui/message_center/views/message_popup_collection.cc ('k') | ui/message_center/views/message_view_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698