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

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

Issue 2870283002: Move message_center::CustomNotificationView to arc::ArcNotificationView (Closed)
Patch Set: Addressed comment 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_
6 #define UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_
7
8 #include "base/macros.h"
9 #include "ui/message_center/message_center_export.h"
10 #include "ui/message_center/views/message_view.h"
11
12 namespace ui {
13 struct AXActionData;
14 }
15
16 namespace views {
17 class Painter;
18 }
19
20 namespace message_center {
21
22 // View for notification with NOTIFICATION_TYPE_CUSTOM that hosts the custom
23 // content of the notification.
24 class MESSAGE_CENTER_EXPORT CustomNotificationView : public MessageView {
25 public:
26 static const char kViewClassName[];
27
28 CustomNotificationView(MessageCenterController* controller,
29 const Notification& notification);
30 ~CustomNotificationView() override;
31
32 // These method are called by the content view when focus handling is defered
33 // to the content.
34 void OnContentFocused();
35 void OnContentBlured();
36
37 // Overridden from MessageView:
38 void SetDrawBackgroundAsActive(bool active) override;
39 bool IsCloseButtonFocused() const override;
40 void RequestFocusOnCloseButton() override;
41 void UpdateControlButtonsVisibility() override;
42
43 // views::SlideOutController::Delegate:
44 void OnSlideChanged() override;
45
46 // Overridden from views::View:
47 const char* GetClassName() const override;
48 gfx::Size GetPreferredSize() const override;
49 void Layout() override;
50 bool HasFocus() const override;
51 void RequestFocus() override;
52 void OnPaint(gfx::Canvas* canvas) override;
53 bool OnKeyPressed(const ui::KeyEvent& event) override;
54 void ChildPreferredSizeChanged(View* child) override;
55 bool HandleAccessibleAction(const ui::AXActionData& action) override;
56
57 private:
58 friend class CustomNotificationViewTest;
59
60 // The view for the custom content. Owned by view hierarchy.
61 views::View* contents_view_ = nullptr;
62 std::unique_ptr<CustomNotificationContentViewDelegate>
63 contents_view_delegate_;
64
65 std::unique_ptr<views::Painter> focus_painter_;
66
67 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView);
68 };
69
70 } // namespace message_center
71
72 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698