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

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

Issue 2849523005: CrOS: Fix appearance of notification toasts when sliding out via gesture (Closed)
Patch Set: update build includes Created 3 years, 8 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_center_view_unittest.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 147e99414561d4a78f28d029fa7d2ed214e33533..c35d539444b864f755c36eb18d130e46c4247a9d 100644
--- a/ui/message_center/views/message_view.h
+++ b/ui/message_center/views/message_view.h
@@ -16,7 +16,8 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/message_center/message_center_export.h"
#include "ui/message_center/notification.h"
-#include "ui/views/controls/slide_out_view.h"
+#include "ui/message_center/views/slide_out_controller.h"
+#include "ui/views/view.h"
namespace views {
class Painter;
@@ -35,7 +36,9 @@ const int kWebNotificationIconSize = 40;
// An base class for a notification entry. Contains background and other
// elements shared by derived notification views.
-class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView {
+class MESSAGE_CENTER_EXPORT MessageView
+ : public views::View,
+ public views::SlideOutController::Delegate {
public:
MessageView(MessageCenterController* controller,
const Notification& notification);
@@ -47,8 +50,8 @@ class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView {
// Returns the insets for the shadow it will have for rich notification.
static gfx::Insets GetShadowInsets();
- // Creates a shadow around the notification.
- void CreateShadowBorder();
+ // Creates a shadow around the notification and changes slide-out behavior.
+ void SetIsNested();
virtual bool IsCloseButtonFocused() const = 0;
virtual void RequestFocusOnCloseButton() = 0;
@@ -57,7 +60,7 @@ class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView {
void OnCloseButtonPressed();
- // Overridden from views::View:
+ // views::View
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
bool OnMousePressed(const ui::MouseEvent& event) override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
@@ -66,10 +69,12 @@ class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView {
void OnFocus() override;
void OnBlur() override;
void Layout() override;
-
- // Overridden from ui::EventHandler:
void OnGestureEvent(ui::GestureEvent* event) override;
+ // views::SlideOutController::Delegate
+ ui::Layer* GetSlideOutLayer() override;
+ void OnSlideOut() override;
+
void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; }
std::string notification_id() { return notification_id_; }
NotifierId notifier_id() { return notifier_id_; }
@@ -80,9 +85,6 @@ class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView {
}
protected:
- // Overridden from views::SlideOutView:
- void OnSlideOut() override;
-
// Creates and add close button to view hierarchy when necessary. Derived
// classes should call this after its view hierarchy is populated to ensure
// it is on top of other views.
@@ -109,6 +111,12 @@ class MESSAGE_CENTER_EXPORT MessageView : public views::SlideOutView {
std::unique_ptr<views::Painter> focus_painter_;
+ views::SlideOutController slide_out_controller_;
+
+ // True if |this| is embedded in another view. Equivalent to |!top_level| in
+ // MessageViewFactory parlance.
+ bool is_nested_ = false;
+
DISALLOW_COPY_AND_ASSIGN(MessageView);
};
« no previous file with comments | « ui/message_center/views/message_center_view_unittest.cc ('k') | ui/message_center/views/message_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698