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

Unified Diff: ui/message_center/message_view.h

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, which led to many changes. Created 7 years, 10 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/message_view.h
diff --git a/ui/message_center/message_view.h b/ui/message_center/message_view.h
index eb1a7dc1bd201b44e3460c436318ef148bc7f2ef..3330b3983aca986af2c970ecb0642efcd26d0672 100644
--- a/ui/message_center/message_view.h
+++ b/ui/message_center/message_view.h
@@ -10,10 +10,10 @@
#include "ui/message_center/notification_list.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/slide_out_view.h"
-#include "ui/views/view.h"
namespace views {
class ImageButton;
+class ImageView;
class ScrollView;
}
@@ -30,52 +30,59 @@ const int kWebNotificationWidth = 300;
class MessageView : public views::SlideOutView,
public views::ButtonListener {
public:
- MessageView(NotificationList::Delegate* list_delegate,
- const Notification& notification);
-
+ MessageView(const Notification& notification,
+ NotificationList::Delegate* delegate,
+ bool expanded);
virtual ~MessageView();
// Returns the insets for the shadow it will have for rich notification.
static gfx::Insets GetShadowInsets();
- void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; }
+ // Adjust to any change in notification data or expanded status.
+ virtual void Update(const Notification& notification);
- // Overridden from views::View.
+ // Overridden from views::View:
virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- // Overridden from ui::EventHandler.
+ // Overridden from ui::EventHandler:
virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- // Overridden from ButtonListener.
+ // Overridden from ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
+ void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; }
+
protected:
MessageView();
// Shows the menu for the notification.
void ShowMenu(gfx::Point screen_location);
- // Overridden from views::SlideOutView.
+ // Overridden from views::SlideOutView:
virtual void OnSlideOut() OVERRIDE;
- NotificationList::Delegate* list_delegate() { return list_delegate_; }
+ NotificationList::Delegate* delegate() { return delegate_; }
const std::string& notification_id() { return notification_id_; }
const string16& display_source() const { return display_source_; }
const std::string& extension_id() const { return extension_id_; }
views::ImageButton* close_button() { return close_button_.get(); }
+ views::ImageButton* expand_button() { return expand_button_.get(); }
views::ScrollView* scroller() { return scroller_; }
+ const bool is_expanded() { return is_expanded_; }
private:
- NotificationList::Delegate* list_delegate_; // Weak, global (MessageCenter).
+ NotificationList::Delegate* delegate_; // Weak reference.
std::string notification_id_;
string16 display_source_;
std::string extension_id_;
scoped_ptr<views::ImageButton> close_button_;
-
+ scoped_ptr<views::ImageButton> expand_button_;
views::ScrollView* scroller_;
+ bool is_expanded_;
+
DISALLOW_COPY_AND_ASSIGN(MessageView);
};

Powered by Google App Engine
This is Rietveld 408576698