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

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

Issue 2644383002: Revert "Put the close button of a notification into focus chain." (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_center/views/custom_notification_content_view_delegate.h"
16 #include "ui/views/controls/button/button.h" 16 #include "ui/views/controls/button/button.h"
17 #include "ui/views/controls/native/native_view_host.h" 17 #include "ui/views/controls/native/native_view_host.h"
18 18
19 namespace exo { 19 namespace exo {
20 class NotificationSurface; 20 class NotificationSurface;
21 } 21 }
22 22
23 namespace views { 23 namespace views {
24 class FocusTraversable;
25 class ImageButton; 24 class ImageButton;
26 class Widget; 25 class Widget;
27 } 26 }
28 27
29 namespace arc { 28 namespace arc {
30 29
31 class ArcCustomNotificationView 30 class ArcCustomNotificationView
32 : public views::NativeViewHost, 31 : public views::NativeViewHost,
33 public views::ButtonListener, 32 public views::ButtonListener,
34 public aura::WindowObserver, 33 public aura::WindowObserver,
35 public ArcCustomNotificationItem::Observer, 34 public ArcCustomNotificationItem::Observer,
36 public ArcNotificationSurfaceManager::Observer { 35 public ArcNotificationSurfaceManager::Observer {
37 public: 36 public:
38 explicit ArcCustomNotificationView(ArcCustomNotificationItem* item); 37 explicit ArcCustomNotificationView(ArcCustomNotificationItem* item);
39 ~ArcCustomNotificationView() override; 38 ~ArcCustomNotificationView() override;
40 39
41 std::unique_ptr<message_center::CustomNotificationContentViewDelegate> 40 std::unique_ptr<message_center::CustomNotificationContentViewDelegate>
42 CreateContentViewDelegate(); 41 CreateContentViewDelegate();
43 42
44 private: 43 private:
45 class ContentViewDelegate; 44 class ContentViewDelegate;
46 class CloseButton;
47 class EventForwarder; 45 class EventForwarder;
48 class SlideHelper; 46 class SlideHelper;
49 47
50 void CreateFloatingCloseButton(); 48 void CreateFloatingCloseButton();
51 void SetSurface(exo::NotificationSurface* surface); 49 void SetSurface(exo::NotificationSurface* surface);
52 void UpdatePreferredSize(); 50 void UpdatePreferredSize();
53 void UpdateCloseButtonVisiblity(); 51 void UpdateCloseButtonVisiblity();
54 void UpdatePinnedState(); 52 void UpdatePinnedState();
55 void UpdateSnapshot(); 53 void UpdateSnapshot();
56 void AttachSurface(); 54 void AttachSurface();
57 55
58 // views::NativeViewHost 56 // views::NativeViewHost
59 void ViewHierarchyChanged( 57 void ViewHierarchyChanged(
60 const ViewHierarchyChangedDetails& details) override; 58 const ViewHierarchyChangedDetails& details) override;
61 void Layout() override; 59 void Layout() override;
62 void OnPaint(gfx::Canvas* canvas) override; 60 void OnPaint(gfx::Canvas* canvas) override;
63 void OnKeyEvent(ui::KeyEvent* event) override; 61 void OnKeyEvent(ui::KeyEvent* event) override;
64 void OnGestureEvent(ui::GestureEvent* event) override; 62 void OnGestureEvent(ui::GestureEvent* event) override;
65 void OnMouseEntered(const ui::MouseEvent& event) override; 63 void OnMouseEntered(const ui::MouseEvent& event) override;
66 void OnMouseExited(const ui::MouseEvent& event) override; 64 void OnMouseExited(const ui::MouseEvent& event) override;
67 void OnFocus() override; 65 void OnFocus() override;
68 void OnBlur() override; 66 void OnBlur() override;
69 views::FocusTraversable* GetFocusTraversable() override;
70 67
71 // views::ButtonListener 68 // views::ButtonListener
72 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 69 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
73 70
74 // aura::WindowObserver 71 // aura::WindowObserver
75 void OnWindowBoundsChanged(aura::Window* window, 72 void OnWindowBoundsChanged(aura::Window* window,
76 const gfx::Rect& old_bounds, 73 const gfx::Rect& old_bounds,
77 const gfx::Rect& new_bounds) override; 74 const gfx::Rect& new_bounds) override;
78 void OnWindowDestroying(aura::Window* window) override; 75 void OnWindowDestroying(aura::Window* window) override;
79 76
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 108
112 // Protects from call loops between Layout and OnWindowBoundsChanged. 109 // Protects from call loops between Layout and OnWindowBoundsChanged.
113 bool in_layout_ = false; 110 bool in_layout_ = false;
114 111
115 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); 112 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView);
116 }; 113 };
117 114
118 } // namespace arc 115 } // namespace arc
119 116
120 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ 117 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698