OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ash/host/ash_window_tree_host.h" | 5 #include "ash/host/ash_window_tree_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/host/ash_window_tree_host_init_params.h" | 9 #include "ash/host/ash_window_tree_host_init_params.h" |
10 #include "ash/host/ash_window_tree_host_unified.h" | 10 #include "ash/host/ash_window_tree_host_unified.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace ash { | 26 namespace ash { |
27 namespace { | 27 namespace { |
28 | 28 |
29 class AshWindowTreeHostOzone : public AshWindowTreeHost, | 29 class AshWindowTreeHostOzone : public AshWindowTreeHost, |
30 public aura::WindowTreeHostPlatform { | 30 public aura::WindowTreeHostPlatform { |
31 public: | 31 public: |
32 explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds); | 32 explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds); |
33 ~AshWindowTreeHostOzone() override; | 33 ~AshWindowTreeHostOzone() override; |
34 | 34 |
35 private: | 35 protected: |
36 // AshWindowTreeHost: | 36 // AshWindowTreeHost: |
37 void ToggleFullScreen() override; | 37 void ToggleFullScreen() override; |
38 bool ConfineCursorToRootWindow() override; | 38 bool ConfineCursorToRootWindow() override; |
39 void UnConfineCursor() override; | 39 void UnConfineCursor() override; |
40 void SetRootWindowTransformer( | 40 void SetRootWindowTransformer( |
41 scoped_ptr<RootWindowTransformer> transformer) override; | 41 scoped_ptr<RootWindowTransformer> transformer) override; |
42 gfx::Insets GetHostInsets() const override; | 42 gfx::Insets GetHostInsets() const override; |
43 aura::WindowTreeHost* AsWindowTreeHost() override; | 43 aura::WindowTreeHost* AsWindowTreeHost() override; |
44 void PrepareForShutdown() override; | 44 void PrepareForShutdown() override; |
45 void SetRootTransform(const gfx::Transform& transform) override; | 45 void SetRootTransform(const gfx::Transform& transform) override; |
46 gfx::Transform GetRootTransform() const override; | 46 gfx::Transform GetRootTransform() const override; |
47 gfx::Transform GetInverseRootTransform() const override; | 47 gfx::Transform GetInverseRootTransform() const override; |
48 void UpdateRootWindowSize(const gfx::Size& host_size) override; | 48 void UpdateRootWindowSize(const gfx::Size& host_size) override; |
49 void OnCursorVisibilityChangedNative(bool show) override; | 49 void OnCursorVisibilityChangedNative(bool show) override; |
50 void SetBounds(const gfx::Rect& bounds) override; | 50 void SetBounds(const gfx::Rect& bounds) override; |
51 void DispatchEvent(ui::Event* event) override; | 51 void DispatchEvent(ui::Event* event) override; |
52 | 52 |
53 // ui::internal::InputMethodDelegate: | 53 // ui::internal::InputMethodDelegate: |
54 ui::EventDispatchDetails DispatchKeyEventPostIME( | 54 ui::EventDispatchDetails DispatchKeyEventPostIME( |
55 ui::KeyEvent* event) override; | 55 ui::KeyEvent* event) override; |
56 | 56 |
| 57 private: |
57 // Temporarily disable the tap-to-click feature. Used on CrOS. | 58 // Temporarily disable the tap-to-click feature. Used on CrOS. |
58 void SetTapToClickPaused(bool state); | 59 void SetTapToClickPaused(bool state); |
59 | 60 |
60 TransformerHelper transformer_helper_; | 61 TransformerHelper transformer_helper_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostOzone); | 63 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostOzone); |
63 }; | 64 }; |
64 | 65 |
65 AshWindowTreeHostOzone::AshWindowTreeHostOzone(const gfx::Rect& initial_bounds) | 66 AshWindowTreeHostOzone::AshWindowTreeHostOzone(const gfx::Rect& initial_bounds) |
66 : aura::WindowTreeHostPlatform(initial_bounds), transformer_helper_(this) { | 67 : aura::WindowTreeHostPlatform(initial_bounds), transformer_helper_(this) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); | 156 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); |
156 | 157 |
157 // Temporarily pause tap-to-click when the cursor is hidden. | 158 // Temporarily pause tap-to-click when the cursor is hidden. |
158 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( | 159 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( |
159 state); | 160 state); |
160 #endif | 161 #endif |
161 } | 162 } |
162 | 163 |
163 } // namespace | 164 } // namespace |
164 | 165 |
165 AshWindowTreeHost* AshWindowTreeHost::Create( | |
166 const AshWindowTreeHostInitParams& init_params) { | |
167 if (init_params.offscreen) | |
168 return new AshWindowTreeHostUnified(init_params.initial_bounds); | |
169 return new AshWindowTreeHostOzone(init_params.initial_bounds); | |
170 } | |
171 | |
172 } // namespace ash | 166 } // namespace ash |
OLD | NEW |