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

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

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WIN_H_
6 #define UI_AURA_WINDOW_TREE_HOST_WIN_H_ 6 #define UI_AURA_WINDOW_TREE_HOST_WIN_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/events/event_source.h" 12 #include "ui/events/event_source.h"
sky 2015/06/04 13:40:28 Can you remove this include from all tree hosts no
Shu Chen 2015/06/04 15:59:26 Done.
13 #include "ui/platform_window/platform_window.h" 13 #include "ui/platform_window/platform_window.h"
14 #include "ui/platform_window/platform_window_delegate.h" 14 #include "ui/platform_window/platform_window_delegate.h"
15 15
16 namespace aura { 16 namespace aura {
17 17
18 class AURA_EXPORT WindowTreeHostWin 18 class AURA_EXPORT WindowTreeHostWin
19 : public WindowTreeHost, 19 : public WindowTreeHost,
20 public ui::EventSource,
21 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) { 20 public NON_EXPORTED_BASE(ui::PlatformWindowDelegate) {
22 public: 21 public:
23 explicit WindowTreeHostWin(const gfx::Rect& bounds); 22 explicit WindowTreeHostWin(const gfx::Rect& bounds);
24 ~WindowTreeHostWin() override; 23 ~WindowTreeHostWin() override;
25 24
26 // WindowTreeHost: 25 // WindowTreeHost:
27 ui::EventSource* GetEventSource() override; 26 ui::EventSource* GetEventSource() override;
28 gfx::AcceleratedWidget GetAcceleratedWidget() override; 27 gfx::AcceleratedWidget GetAcceleratedWidget() override;
29 void Show() override; 28 void Show() override;
30 void Hide() override; 29 void Hide() override;
31 gfx::Rect GetBounds() const override; 30 gfx::Rect GetBounds() const override;
32 void SetBounds(const gfx::Rect& bounds) override; 31 void SetBounds(const gfx::Rect& bounds) override;
33 gfx::Point GetLocationOnNativeScreen() const override; 32 gfx::Point GetLocationOnNativeScreen() const override;
34 void SetCapture() override; 33 void SetCapture() override;
35 void ReleaseCapture() override; 34 void ReleaseCapture() override;
36 void SetCursorNative(gfx::NativeCursor cursor) override; 35 void SetCursorNative(gfx::NativeCursor cursor) override;
37 void MoveCursorToNative(const gfx::Point& location) override; 36 void MoveCursorToNative(const gfx::Point& location) override;
38 void OnCursorVisibilityChangedNative(bool show) override; 37 void OnCursorVisibilityChangedNative(bool show) override;
39 38
40 // ui::EventSource:
41 ui::EventProcessor* GetEventProcessor() override;
42
43 protected: 39 protected:
44 gfx::AcceleratedWidget hwnd() const { return widget_; } 40 gfx::AcceleratedWidget hwnd() const { return widget_; }
45 41
46 private: 42 private:
47 // ui::PlatformWindowDelegate: 43 // ui::PlatformWindowDelegate:
48 void OnBoundsChanged(const gfx::Rect& new_bounds) override; 44 void OnBoundsChanged(const gfx::Rect& new_bounds) override;
49 void OnDamageRect(const gfx::Rect& damaged_region) override; 45 void OnDamageRect(const gfx::Rect& damaged_region) override;
50 void DispatchEvent(ui::Event* event) override; 46 void DispatchEvent(ui::Event* event) override;
51 void OnCloseRequest() override; 47 void OnCloseRequest() override;
52 void OnClosed() override; 48 void OnClosed() override;
53 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; 49 void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
54 void OnLostCapture() override; 50 void OnLostCapture() override;
55 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; 51 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override;
56 void OnActivationChanged(bool active) override; 52 void OnActivationChanged(bool active) override;
57 53
58 bool has_capture_; 54 bool has_capture_;
59 gfx::Rect bounds_; 55 gfx::Rect bounds_;
60 gfx::AcceleratedWidget widget_; 56 gfx::AcceleratedWidget widget_;
61 scoped_ptr<ui::PlatformWindow> window_; 57 scoped_ptr<ui::PlatformWindow> window_;
62 58
63 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostWin); 59 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostWin);
64 }; 60 };
65 61
66 } // namespace aura 62 } // namespace aura
67 63
68 #endif // UI_AURA_WINDOW_TREE_HOST_WIN_H_ 64 #endif // UI_AURA_WINDOW_TREE_HOST_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698