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

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

Issue 2897903002: [Notifications] Fix swipe to close for ARC notifications. (Closed)
Patch Set: Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_CUSTOM_NOTIFICATION_VIEW_H_ 5 #ifndef UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_
6 #define UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ 6 #define UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/message_center/message_center_export.h" 9 #include "ui/message_center/message_center_export.h"
10 #include "ui/message_center/views/message_view.h" 10 #include "ui/message_center/views/message_view.h"
(...skipping 12 matching lines...) Expand all
23 23
24 CustomNotificationView(MessageCenterController* controller, 24 CustomNotificationView(MessageCenterController* controller,
25 const Notification& notification); 25 const Notification& notification);
26 ~CustomNotificationView() override; 26 ~CustomNotificationView() override;
27 27
28 // These method are called by the content view when focus handling is defered 28 // These method are called by the content view when focus handling is defered
29 // to the content. 29 // to the content.
30 void OnContentFocused(); 30 void OnContentFocused();
31 void OnContentBlured(); 31 void OnContentBlured();
32 32
33 // Overidden from MessageView: 33 // Overridden from MessageView:
34 void SetDrawBackgroundAsActive(bool active) override; 34 void SetDrawBackgroundAsActive(bool active) override;
35 bool IsCloseButtonFocused() const override; 35 bool IsCloseButtonFocused() const override;
36 void RequestFocusOnCloseButton() override; 36 void RequestFocusOnCloseButton() override;
37 bool IsPinned() const override; 37 bool IsPinned() const override;
38 void UpdateControlButtonsVisibility() override; 38 void UpdateControlButtonsVisibility() override;
39 39
40 // views::SlideOutController::Delegate:
41 void OnSlideChanged() override;
42
40 // Overridden from views::View: 43 // Overridden from views::View:
41 const char* GetClassName() const override; 44 const char* GetClassName() const override;
42 gfx::Size GetPreferredSize() const override; 45 gfx::Size GetPreferredSize() const override;
43 void Layout() override; 46 void Layout() override;
44 bool HasFocus() const override; 47 bool HasFocus() const override;
45 void RequestFocus() override; 48 void RequestFocus() override;
46 void OnPaint(gfx::Canvas* canvas) override; 49 void OnPaint(gfx::Canvas* canvas) override;
47 bool OnKeyPressed(const ui::KeyEvent& event) override; 50 bool OnKeyPressed(const ui::KeyEvent& event) override;
48 void ChildPreferredSizeChanged(View* child) override; 51 void ChildPreferredSizeChanged(View* child) override;
49 bool OnMousePressed(const ui::MouseEvent& event) override; 52 bool OnMousePressed(const ui::MouseEvent& event) override;
50 53
51 private: 54 private:
52 friend class CustomNotificationViewTest; 55 friend class CustomNotificationViewTest;
53 56
54 // The view for the custom content. Owned by view hierarchy. 57 // The view for the custom content. Owned by view hierarchy.
55 views::View* contents_view_ = nullptr; 58 views::View* contents_view_ = nullptr;
56 std::unique_ptr<CustomNotificationContentViewDelegate> 59 std::unique_ptr<CustomNotificationContentViewDelegate>
57 contents_view_delegate_; 60 contents_view_delegate_;
58 61
59 std::unique_ptr<views::Painter> focus_painter_; 62 std::unique_ptr<views::Painter> focus_painter_;
60 63
61 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView); 64 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView);
62 }; 65 };
63 66
64 } // namespace message_center 67 } // namespace message_center
65 68
66 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_ 69 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698