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

Unified Diff: ui/aura/window_tree_host_win.h

Issue 400413002: aura: Use PlatformWindow from WindowTreeHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/aura/window_tree_host_win.h
diff --git a/ui/aura/window_tree_host_win.h b/ui/aura/window_tree_host_win.h
index fa4b4782d247afe29850a8f18252a9c26a4997d5..f2c5e85baf808bad2dd8e1afe52a3b0752ee40e6 100644
--- a/ui/aura/window_tree_host_win.h
+++ b/ui/aura/window_tree_host_win.h
@@ -6,19 +6,23 @@
#define UI_AURA_WINDOW_TREE_HOST_WIN_H_
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "ui/aura/aura_export.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event_source.h"
-#include "ui/gfx/win/window_impl.h"
+#include "ui/platform_window/platform_window.h"
+#include "ui/platform_window/platform_window_delegate.h"
namespace aura {
-class AURA_EXPORT WindowTreeHostWin : public WindowTreeHost,
- public ui::EventSource,
- public gfx::WindowImpl {
+class AURA_EXPORT WindowTreeHostWin
+ : public WindowTreeHost,
+ public ui::EventSource,
+ public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) {
public:
explicit WindowTreeHostWin(const gfx::Rect& bounds);
virtual ~WindowTreeHostWin();
+
// WindowTreeHost:
virtual ui::EventSource* GetEventSource() OVERRIDE;
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
@@ -37,56 +41,30 @@ class AURA_EXPORT WindowTreeHostWin : public WindowTreeHost,
// ui::EventSource:
virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
- private:
- CR_BEGIN_MSG_MAP_EX(WindowTreeHostWin)
- // Range handlers must go first!
- CR_MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange)
- CR_MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE,
- WM_NCXBUTTONDBLCLK,
- OnMouseRange)
-
- // Mouse capture events.
- CR_MESSAGE_HANDLER_EX(WM_CAPTURECHANGED, OnCaptureChanged)
-
- // Key events.
- CR_MESSAGE_HANDLER_EX(WM_KEYDOWN, OnKeyEvent)
- CR_MESSAGE_HANDLER_EX(WM_KEYUP, OnKeyEvent)
- CR_MESSAGE_HANDLER_EX(WM_SYSKEYDOWN, OnKeyEvent)
- CR_MESSAGE_HANDLER_EX(WM_SYSKEYUP, OnKeyEvent)
- CR_MESSAGE_HANDLER_EX(WM_CHAR, OnKeyEvent)
- CR_MESSAGE_HANDLER_EX(WM_SYSCHAR, OnKeyEvent)
- CR_MESSAGE_HANDLER_EX(WM_IME_CHAR, OnKeyEvent)
- CR_MESSAGE_HANDLER_EX(WM_NCACTIVATE, OnNCActivate)
-
- CR_MSG_WM_CLOSE(OnClose)
- CR_MSG_WM_MOVE(OnMove)
- CR_MSG_WM_PAINT(OnPaint)
- CR_MSG_WM_SIZE(OnSize)
- CR_END_MSG_MAP()
+ protected:
+ gfx::AcceleratedWidget hwnd() const { return widget_; }
- void OnClose();
- LRESULT OnKeyEvent(UINT message, WPARAM w_param, LPARAM l_param);
- LRESULT OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param);
- LRESULT OnCaptureChanged(UINT message, WPARAM w_param, LPARAM l_param);
- LRESULT OnNCActivate(UINT message, WPARAM w_param, LPARAM l_param);
- void OnMove(const gfx::Point& point);
- void OnPaint(HDC dc);
- void OnSize(UINT param, const gfx::Size& size);
+ private:
+ // ui::PlatformWindowDelegate:
+ virtual void OnBoundsChanged(const gfx::Rect& new_bounds) OVERRIDE;
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE;
+ virtual void DispatchEvent(ui::Event* event) OVERRIDE;
+ virtual void OnCloseRequest() OVERRIDE;
+ virtual void OnClosed() OVERRIDE;
+ virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) OVERRIDE;
+ virtual void OnLostCapture() OVERRIDE;
+ virtual void OnAcceleratedWidgetAvailable(
+ gfx::AcceleratedWidget widget) OVERRIDE;
+ virtual void OnActivationChanged(bool active) OVERRIDE;
bool has_capture_;
+ gfx::Rect bounds_;
+ gfx::AcceleratedWidget widget_;
+ scoped_ptr<ui::PlatformWindow> window_;
DISALLOW_COPY_AND_ASSIGN(WindowTreeHostWin);
};
-namespace test {
-
-// Set true to let WindowTreeHostWin use a popup window
-// with no frame/title so that the window size and test's
-// expectations matches.
-AURA_EXPORT void SetUsePopupAsRootWindowForTest(bool use);
-
-} // namespace
-
} // namespace aura
#endif // UI_AURA_WINDOW_TREE_HOST_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698