summaryrefslogtreecommitdiffstats
path: root/ui/platform_window/platform_window_delegate.h
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 17:47:10 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 17:47:10 +0000
commit31fbcd953ebbfec6489ef4076cf816a56c4eab30 (patch)
tree49c6ec09149f1678b95e0ea298157203aab52025 /ui/platform_window/platform_window_delegate.h
parent559f2b2959879ce098e03454df8ccc7b8736b7cd (diff)
downloadchromium_src-31fbcd953ebbfec6489ef4076cf816a56c4eab30.zip
chromium_src-31fbcd953ebbfec6489ef4076cf816a56c4eab30.tar.gz
chromium_src-31fbcd953ebbfec6489ef4076cf816a56c4eab30.tar.bz2
ui/platform_window: Introduce PlatformWindow for windowing primitives.
Instead of implementing the native windowing primitives for aura, mojo, ozone etc., have a single implementation in ui/platform_window, and use that in the rest of the places. To start off, this CL provides an X11 implementation of the new interface, and use it for mojo native-viewport. BUG=361137 R=ben@chromium.org, spang@chromium.org Review URL: https://codereview.chromium.org/391583002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/platform_window/platform_window_delegate.h')
-rw-r--r--ui/platform_window/platform_window_delegate.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/ui/platform_window/platform_window_delegate.h b/ui/platform_window/platform_window_delegate.h
new file mode 100644
index 0000000..bf5d0a1
--- /dev/null
+++ b/ui/platform_window/platform_window_delegate.h
@@ -0,0 +1,52 @@
+// Copyright 2014 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_PLATFORM_WINDOW_PLATFORM_WINDOW_DELEGATE_H_
+#define UI_PLATFORM_WINDOW_PLATFORM_WINDOW_DELEGATE_H_
+
+#include "ui/gfx/native_widget_types.h"
+#include "ui/platform_window/platform_window_export.h"
+
+namespace gfx {
+class Rect;
+}
+
+namespace ui {
+
+class Event;
+
+enum PlatformWindowState {
+ PLATFORM_WINDOW_STATE_UNKNOWN,
+ PLATFORM_WINDOW_STATE_MAXIMIZED,
+ PLATFORM_WINDOW_STATE_MINIMIZED,
+ PLATFORM_WINDOW_STATE_NORMAL,
+ PLATFORM_WINDOW_STATE_FULLSCREEN,
+};
+
+class PLATFORM_WINDOW_EXPORT PlatformWindowDelegate {
+ public:
+ virtual ~PlatformWindowDelegate() {}
+
+ // Note that |new_bounds| is in physical screen coordinates.
+ virtual void OnBoundsChanged(const gfx::Rect& new_bounds) = 0;
+
+ // Note that |damaged_region| is in the platform-window's coordinates, in
+ // physical pixels.
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) = 0;
+
+ virtual void DispatchEvent(Event* event) = 0;
+
+ virtual void OnCloseRequest() = 0;
+ virtual void OnClosed() = 0;
+
+ virtual void OnWindowStateChanged(PlatformWindowState new_state) = 0;
+
+ virtual void OnLostCapture() = 0;
+
+ virtual void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) = 0;
+};
+
+} // namespace ui
+
+#endif // UI_PLATFORM_WINDOW_PLATFORM_WINDOW_DELEGATE_H_