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

Side by Side Diff: ui/aura/window_tree_host_platform.h

Issue 1390883003: aura: Unify WindowTreeHost for some platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win build Created 5 years, 2 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 2015 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_AURA_WINDOW_TREE_HOST_WIN_H_ 5 #ifndef UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_
6 #define UI_AURA_WINDOW_TREE_HOST_WIN_H_ 6 #define UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/aura/aura_export.h" 10 #include "ui/aura/aura_export.h"
11 #include "ui/aura/window_tree_host.h" 11 #include "ui/aura/window_tree_host.h"
12 #include "ui/gfx/native_widget_types.h"
12 #include "ui/platform_window/platform_window.h" 13 #include "ui/platform_window/platform_window.h"
13 #include "ui/platform_window/platform_window_delegate.h" 14 #include "ui/platform_window/platform_window_delegate.h"
14 15
15 namespace aura { 16 namespace aura {
16 17
17 class AURA_EXPORT WindowTreeHostWin 18 // The unified WindowTreeHost implementation for platforms
19 // that implement PlatformWindow.
20 class AURA_EXPORT WindowTreeHostPlatform
18 : public WindowTreeHost, 21 : public WindowTreeHost,
19 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) { 22 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) {
20 public: 23 public:
21 explicit WindowTreeHostWin(const gfx::Rect& bounds); 24 explicit WindowTreeHostPlatform(const gfx::Rect& bounds);
22 ~WindowTreeHostWin() override; 25 ~WindowTreeHostPlatform() override;
23 26
27 public:
sadrul 2015/10/15 19:47:40 not needed.
no sievers 2015/10/16 18:26:15 Done.
24 // WindowTreeHost: 28 // WindowTreeHost:
25 ui::EventSource* GetEventSource() override; 29 ui::EventSource* GetEventSource() override;
26 gfx::AcceleratedWidget GetAcceleratedWidget() override; 30 gfx::AcceleratedWidget GetAcceleratedWidget() override;
27 void ShowImpl() override; 31 void ShowImpl() override;
28 void HideImpl() override; 32 void HideImpl() override;
29 gfx::Rect GetBounds() const override; 33 gfx::Rect GetBounds() const override;
30 void SetBounds(const gfx::Rect& bounds) override; 34 void SetBounds(const gfx::Rect& bounds) override;
31 gfx::Point GetLocationOnNativeScreen() const override; 35 gfx::Point GetLocationOnNativeScreen() const override;
32 void SetCapture() override; 36 void SetCapture() override;
33 void ReleaseCapture() override; 37 void ReleaseCapture() override;
34 void SetCursorNative(gfx::NativeCursor cursor) override; 38 void SetCursorNative(gfx::NativeCursor cursor) override;
35 void MoveCursorToNative(const gfx::Point& location) override; 39 void MoveCursorToNative(const gfx::Point& location) override;
36 void OnCursorVisibilityChangedNative(bool show) override; 40 void OnCursorVisibilityChangedNative(bool show) override;
37 41
38 protected: 42 protected:
39 gfx::AcceleratedWidget hwnd() const { return widget_; } 43 ui::PlatformWindow* platform_window() { return window_.get(); }
40 44
41 private: 45 private:
42 // ui::PlatformWindowDelegate: 46 // ui::PlatformWindowDelegate:
43 void OnBoundsChanged(const gfx::Rect& new_bounds) override; 47 void OnBoundsChanged(const gfx::Rect& new_bounds) override;
44 void OnDamageRect(const gfx::Rect& damaged_region) override; 48 void OnDamageRect(const gfx::Rect& damaged_region) override;
45 void DispatchEvent(ui::Event* event) override; 49 void DispatchEvent(ui::Event* event) override;
46 void OnCloseRequest() override; 50 void OnCloseRequest() override;
47 void OnClosed() override; 51 void OnClosed() override;
48 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; 52 void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
49 void OnLostCapture() override; 53 void OnLostCapture() override;
50 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, 54 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget,
51 float device_pixel_ratio) override; 55 float device_pixel_ratio) override;
52 void OnActivationChanged(bool active) override; 56 void OnActivationChanged(bool active) override;
53 57
58 gfx::AcceleratedWidget widget_;
59 scoped_ptr<ui::PlatformWindow> window_;
60 gfx::NativeCursor current_cursor_;
54 bool has_capture_; 61 bool has_capture_;
55 gfx::Rect bounds_; 62 gfx::Rect bounds_;
56 gfx::AcceleratedWidget widget_;
57 scoped_ptr<ui::PlatformWindow> window_;
58 63
59 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostWin); 64 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostPlatform);
60 }; 65 };
61 66
62 } // namespace aura 67 } // namespace aura
63 68
64 #endif // UI_AURA_WINDOW_TREE_HOST_WIN_H_ 69 #endif // UI_AURA_WINDOW_TREE_HOST_PLATFORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698