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

Side by Side Diff: ui/arc/notification/arc_custom_notification_view.h

Issue 2547433002: Transfer responsibility for providing a close button for a notification to each implementation of M… (Closed)
Patch Set: address the review comments Created 4 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
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_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ 5 #ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_
6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ 6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "ui/arc/notification/arc_custom_notification_item.h" 12 #include "ui/arc/notification/arc_custom_notification_item.h"
13 #include "ui/arc/notification/arc_notification_surface_manager.h" 13 #include "ui/arc/notification/arc_notification_surface_manager.h"
14 #include "ui/aura/window_observer.h" 14 #include "ui/aura/window_observer.h"
15 #include "ui/message_center/views/custom_notification_content_view_delegate.h"
15 #include "ui/views/controls/button/button.h" 16 #include "ui/views/controls/button/button.h"
16 #include "ui/views/controls/native/native_view_host.h" 17 #include "ui/views/controls/native/native_view_host.h"
17 18
18 namespace exo { 19 namespace exo {
19 class NotificationSurface; 20 class NotificationSurface;
20 } 21 }
21 22
22 namespace views { 23 namespace views {
23 class ImageButton; 24 class ImageButton;
24 class Widget; 25 class Widget;
25 } 26 }
26 27
27 namespace arc { 28 namespace arc {
28 29
29 class ArcCustomNotificationView 30 class ArcCustomNotificationView
30 : public views::NativeViewHost, 31 : public views::NativeViewHost,
31 public views::ButtonListener, 32 public views::ButtonListener,
32 public aura::WindowObserver, 33 public aura::WindowObserver,
33 public ArcCustomNotificationItem::Observer, 34 public ArcCustomNotificationItem::Observer,
34 public ArcNotificationSurfaceManager::Observer { 35 public ArcNotificationSurfaceManager::Observer {
35 public: 36 public:
36 explicit ArcCustomNotificationView(ArcCustomNotificationItem* item); 37 explicit ArcCustomNotificationView(ArcCustomNotificationItem* item);
37 ~ArcCustomNotificationView() override; 38 ~ArcCustomNotificationView() override;
38 39
40 std::unique_ptr<message_center::CustomNotificationContentViewDelegate>
41 CreateContentViewDelegate();
yoshiki 2016/12/06 05:28:27 Shouldn't we need to add 4-space indent?
42
39 private: 43 private:
44 class ContentViewDelegate;
40 class EventForwarder; 45 class EventForwarder;
41 class SlideHelper; 46 class SlideHelper;
42 47
43 void CreateFloatingCloseButton(); 48 void CreateFloatingCloseButton();
44 void SetSurface(exo::NotificationSurface* surface); 49 void SetSurface(exo::NotificationSurface* surface);
45 void UpdatePreferredSize(); 50 void UpdatePreferredSize();
46 void UpdateCloseButtonVisiblity(); 51 void UpdateCloseButtonVisiblity();
47 void UpdatePinnedState(); 52 void UpdatePinnedState();
48 void UpdateSnapshot(); 53 void UpdateSnapshot();
49 void AttachSurface(); 54 void AttachSurface();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 106
102 // Protects from call loops between Layout and OnWindowBoundsChanged. 107 // Protects from call loops between Layout and OnWindowBoundsChanged.
103 bool in_layout_ = false; 108 bool in_layout_ = false;
104 109
105 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); 110 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView);
106 }; 111 };
107 112
108 } // namespace arc 113 } // namespace arc
109 114
110 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ 115 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698