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

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

Issue 114323002: Fixes the context menu for a notification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
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 "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "ui/gfx/insets.h" 10 #include "ui/gfx/insets.h"
11 #include "ui/message_center/message_center_export.h" 11 #include "ui/message_center/message_center_export.h"
12 #include "ui/message_center/notification.h" 12 #include "ui/message_center/notification.h"
13 #include "ui/views/controls/button/button.h" 13 #include "ui/views/controls/button/button.h"
14 #include "ui/views/controls/slide_out_view.h" 14 #include "ui/views/controls/slide_out_view.h"
15 15
16 namespace views { 16 namespace views {
17 class ImageButton; 17 class ImageButton;
18 class Painter; 18 class Painter;
19 class ScrollView; 19 class ScrollView;
20 } 20 }
21 21
22 namespace message_center { 22 namespace message_center {
23 23
24 class MessageCenter; 24 class MessageCenter;
25 class MessageCenterTray; 25 class MessageCenterTray;
26 class MessageViewContextMenuController;
27 26
28 // Individual notifications constants. 27 // Individual notifications constants.
29 const int kPaddingBetweenItems = 10; 28 const int kPaddingBetweenItems = 10;
30 const int kPaddingHorizontal = 18; 29 const int kPaddingHorizontal = 18;
31 const int kWebNotificationButtonWidth = 32; 30 const int kWebNotificationButtonWidth = 32;
32 const int kWebNotificationIconSize = 40; 31 const int kWebNotificationIconSize = 40;
33 32
34 // An abstract class that forms the basis of a view for a notification entry. 33 // An abstract class that forms the basis of a view for a notification entry.
35 class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView, 34 class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView,
36 public views::ButtonListener { 35 public views::ButtonListener {
37 public: 36 public:
38 MessageView(const string16& display_source); 37 MessageView();
39 virtual ~MessageView(); 38 virtual ~MessageView();
40 39
41 // Overrided by derived classes. 40 // Overrided by derived classes.
42 virtual void ClickOnNotification() = 0; 41 virtual void ClickOnNotification() = 0;
43 virtual void RemoveNotification(bool by_user) = 0; 42 virtual void RemoveNotification(bool by_user) = 0;
44 virtual void DisableNotificationsFromThisSource() = 0;
45 virtual void ShowNotifierSettingsBubble() = 0;
46 43
47 // Returns the insets for the shadow it will have for rich notification. 44 // Returns the insets for the shadow it will have for rich notification.
48 static gfx::Insets GetShadowInsets(); 45 static gfx::Insets GetShadowInsets();
49 46
50 // Creates a shadow around the notification. 47 // Creates a shadow around the notification.
51 void CreateShadowBorder(); 48 void CreateShadowBorder();
52 49
53 bool IsCloseButtonFocused(); 50 bool IsCloseButtonFocused();
54 void RequestFocusOnCloseButton(); 51 void RequestFocusOnCloseButton();
55 52
(...skipping 18 matching lines...) Expand all
74 void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; } 71 void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; }
75 72
76 protected: 73 protected:
77 // Overridden from views::SlideOutView: 74 // Overridden from views::SlideOutView:
78 virtual void OnSlideOut() OVERRIDE; 75 virtual void OnSlideOut() OVERRIDE;
79 76
80 views::ImageButton* close_button() { return close_button_.get(); } 77 views::ImageButton* close_button() { return close_button_.get(); }
81 views::ScrollView* scroller() { return scroller_; } 78 views::ScrollView* scroller() { return scroller_; }
82 79
83 private: 80 private:
84 scoped_ptr<MessageViewContextMenuController> context_menu_controller_;
85 scoped_ptr<views::ImageButton> close_button_; 81 scoped_ptr<views::ImageButton> close_button_;
86 views::ScrollView* scroller_; 82 views::ScrollView* scroller_;
87 83
88 string16 accessible_name_; 84 string16 accessible_name_;
89 85
90 scoped_ptr<views::Painter> focus_painter_; 86 scoped_ptr<views::Painter> focus_painter_;
91 87
92 DISALLOW_COPY_AND_ASSIGN(MessageView); 88 DISALLOW_COPY_AND_ASSIGN(MessageView);
93 }; 89 };
94 90
95 } // namespace message_center 91 } // namespace message_center
96 92
97 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_ 93 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698