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

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

Issue 2870283002: Move message_center::CustomNotificationView to arc::ArcNotificationView (Closed)
Patch Set: Fixed test 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 // Overidden from MessageView:
38 void SetDrawBackgroundAsActive(bool active) override;
39 bool IsCloseButtonFocused() const override;
40 void RequestFocusOnCloseButton() override;
41 void UpdateControlButtonsVisibility() override;
42
43 // Overridden from views::View:
44 const char* GetClassName() const override;
45 gfx::Size GetPreferredSize() const override;
46 void Layout() override;
47 bool HasFocus() const override;
48 void RequestFocus() override;
49 void OnPaint(gfx::Canvas* canvas) override;
50 bool OnKeyPressed(const ui::KeyEvent& event) override;
51 void ChildPreferredSizeChanged(View* child) override;
52 bool HandleAccessibleAction(const ui::AXActionData& action) override;
53
54 private:
55 friend class CustomNotificationViewTest;
56
57 // The view for the custom content. Owned by view hierarchy.
58 views::View* contents_view_ = nullptr;
59 std::unique_ptr<CustomNotificationContentViewDelegate>
60 contents_view_delegate_;
61
62 std::unique_ptr<views::Painter> focus_painter_;
63
64 DISALLOW_COPY_AND_ASSIGN(CustomNotificationView);
65 };
66
67 } // namespace message_center
68
69 #endif // UI_MESSAGE_CENTER_VIEWS_CUSTOM_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698