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

Side by Side Diff: ui/views/widget/desktop_aura/window_event_filter.h

Issue 2948553002: Decouple X11WindowEventFilter into WindowEventFilter parent class. (Closed)
Patch Set: rebased, added erg to owners Created 3 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
sadrul 2017/06/28 04:41:58 No (c)
msisov 2017/06/28 20:55:04 Done.
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_VIEWS_WIDGET_DESKTOP_AURA_X11_WINDOW_EVENT_FILTER_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_EVENT_FILTER_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WINDOW_EVENT_FILTER_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_EVENT_FILTER_H_
7
8 #include <X11/Xlib.h>
9 7
10 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
11 #include "base/macros.h" 9 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
13 #include "ui/events/event_handler.h" 11 #include "ui/events/event_handler.h"
14 #include "ui/gfx/x/x11_types.h"
15 #include "ui/views/views_export.h" 12 #include "ui/views/views_export.h"
16 13
17 namespace aura {
18 class Window;
19 }
20
21 namespace gfx {
22 class Point;
23 }
24
25 namespace views { 14 namespace views {
26 class DesktopWindowTreeHost; 15 class DesktopWindowTreeHost;
27 16
28 // An EventFilter that sets properties on X11 windows. 17 // An EventFilter that sets properties on native windows.
sadrul 2017/06/28 04:41:58 Add a comment that downstream projects use this (m
msisov 2017/06/28 20:55:04 Done.
29 class VIEWS_EXPORT X11WindowEventFilter : public ui::EventHandler { 18 class VIEWS_EXPORT WindowEventFilter : public ui::EventHandler {
30 public: 19 public:
31 explicit X11WindowEventFilter(DesktopWindowTreeHost* window_tree_host); 20 explicit WindowEventFilter(DesktopWindowTreeHost* window_tree_host);
32 ~X11WindowEventFilter() override; 21 ~WindowEventFilter() override;
33 22
34 // Overridden from ui::EventHandler: 23 // Overridden from ui::EventHandler:
35 void OnMouseEvent(ui::MouseEvent* event) override; 24 void OnMouseEvent(ui::MouseEvent* event) override;
36 25
37 private: 26 private:
38 // Called when the user clicked the caption area. 27 // Called when the user clicked the caption area.
39 void OnClickedCaption(ui::MouseEvent* event, 28 void OnClickedCaption(ui::MouseEvent* event, int previous_click_component);
40 int previous_click_component);
41 29
42 // Called when the user clicked the maximize button. 30 // Called when the user clicked the maximize button.
43 void OnClickedMaximizeButton(ui::MouseEvent* event); 31 void OnClickedMaximizeButton(ui::MouseEvent* event);
44 32
45 void ToggleMaximizedState(); 33 void ToggleMaximizedState();
46 34
47 // Dispatches a _NET_WM_MOVERESIZE message to the window manager to tell it 35 // Dispatches a _NET_WM_MOVERESIZE message to the window manager to tell it
48 // to act as if a border or titlebar drag occurred. 36 // to act as if a border or titlebar drag occurred.
sadrul 2017/06/28 04:41:58 This documentation should be updated to reflect wh
msisov 2017/06/28 20:55:04 Done.
49 bool DispatchHostWindowDragMovement(int hittest, 37 virtual void MaybeDispatchHostWindowDragMovement(int hittest,
50 const gfx::Point& screen_location); 38 ui::MouseEvent* event);
51 39
52 // The display and the native X window hosting the root window. 40 virtual void LowerWindow();
sadrul 2017/06/28 04:41:58 Document what this is expected to do.
msisov 2017/06/28 20:55:04 Done.
53 XDisplay* xdisplay_;
54 ::Window xwindow_;
55
56 // The native root window.
57 ::Window x_root_window_;
58 41
59 DesktopWindowTreeHost* window_tree_host_; 42 DesktopWindowTreeHost* window_tree_host_;
60 43
61 // The non-client component for the target of a MouseEvent. Mouse events can 44 // The non-client component for the target of a MouseEvent. Mouse events can
62 // be destructive to the window tree, which can cause the component of a 45 // be destructive to the window tree, which can cause the component of a
63 // ui::EF_IS_DOUBLE_CLICK event to no longer be the same as that of the 46 // ui::EF_IS_DOUBLE_CLICK event to no longer be the same as that of the
64 // initial click. Acting on a double click should only occur for matching 47 // initial click. Acting on a double click should only occur for matching
65 // components. 48 // components.
66 int click_component_; 49 int click_component_;
67 50
68 DISALLOW_COPY_AND_ASSIGN(X11WindowEventFilter); 51 DISALLOW_COPY_AND_ASSIGN(WindowEventFilter);
69 }; 52 };
70 53
71 } // namespace views 54 } // namespace views
72 55
73 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WINDOW_EVENT_FILTER_H_ 56 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_EVENT_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698