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

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

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, rebase, and rebase again! Created 7 years, 9 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
« no previous file with comments | « ui/message_center/views/message_simple_view.cc ('k') | ui/message_center/views/message_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86920b958714f879a1c8fa4d755b506f9b3c2e5b..37725dbf5cfbc7bdcac3463e0f8895b04d069970 100644
--- a/ui/message_center/views/message_view.h
+++ b/ui/message_center/views/message_view.h
@@ -7,18 +7,19 @@
#include "ui/gfx/insets.h"
#include "ui/message_center/notification.h"
-#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;
}
namespace message_center {
+class NotificationChangeObserver;
+
// Individual notifications constants.
const int kPaddingBetweenItems = 10;
const int kPaddingHorizontal = 18;
@@ -30,52 +31,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,
+ NotificationChangeObserver* observer,
+ 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_; }
+ NotificationChangeObserver* observer() { return observer_; }
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).
+ NotificationChangeObserver* observer_; // 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);
};
« no previous file with comments | « ui/message_center/views/message_simple_view.cc ('k') | ui/message_center/views/message_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698