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

Unified Diff: ui/views/widget/desktop_aura/window_event_filter.h

Issue 2948553002: Decouple X11WindowEventFilter into WindowEventFilter parent class. (Closed)
Patch Set: change function order Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/OWNERS ('k') | ui/views/widget/desktop_aura/window_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/window_event_filter.h
diff --git a/ui/views/widget/desktop_aura/window_event_filter.h b/ui/views/widget/desktop_aura/window_event_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..9d765cf73dd9b53e5cb37f04c66b4404cb262d8b
--- /dev/null
+++ b/ui/views/widget/desktop_aura/window_event_filter.h
@@ -0,0 +1,61 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_EVENT_FILTER_H_
+#define UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_EVENT_FILTER_H_
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/message_loop/message_loop.h"
+#include "ui/events/event_handler.h"
+#include "ui/views/views_export.h"
+
+namespace views {
+class DesktopWindowTreeHost;
+
+// An EventFilter that sets properties on native windows.
+// The downstream effort to add wayland and x11 support with ozone
+// are using this class (to be upstreamed later).
+class VIEWS_EXPORT WindowEventFilter : public ui::EventHandler {
+ public:
+ explicit WindowEventFilter(DesktopWindowTreeHost* window_tree_host);
+ ~WindowEventFilter() override;
+
+ // Overridden from ui::EventHandler:
+ void OnMouseEvent(ui::MouseEvent* event) override;
+
+ private:
+ // Called when the user clicked the caption area.
+ void OnClickedCaption(ui::MouseEvent* event, int previous_click_component);
+
+ // Called when the user clicked the maximize button.
+ void OnClickedMaximizeButton(ui::MouseEvent* event);
+
+ void ToggleMaximizedState();
+
+ // Dispatches a message to the window manager to tell it to act as if a border
+ // or titlebar drag occurred with left mouse click. In case of X11, a
+ // _NET_WM_MOVERESIZE message is sent.
+ virtual void MaybeDispatchHostWindowDragMovement(int hittest,
+ ui::MouseEvent* event);
+
+ // A signal to lower an attached to this filter window to the bottom of the
+ // stack.
+ virtual void LowerWindow();
+
+ DesktopWindowTreeHost* window_tree_host_;
+
+ // The non-client component for the target of a MouseEvent. Mouse events can
+ // be destructive to the window tree, which can cause the component of a
+ // ui::EF_IS_DOUBLE_CLICK event to no longer be the same as that of the
+ // initial click. Acting on a double click should only occur for matching
+ // components.
+ int click_component_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowEventFilter);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_EVENT_FILTER_H_
« no previous file with comments | « ui/views/widget/desktop_aura/OWNERS ('k') | ui/views/widget/desktop_aura/window_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698