OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_platform.h" | 5 #include "ash/host/ash_window_tree_host_platform.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/host/root_window_transformer.h" | 9 #include "ash/host/root_window_transformer.h" |
10 #include "ash/host/transformer_helper.h" | 10 #include "ash/host/transformer_helper.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 confined_bounds.Inset(transformer_helper_.GetHostInsets()); | 47 confined_bounds.Inset(transformer_helper_.GetHostInsets()); |
48 platform_window()->ConfineCursorToBounds(confined_bounds); | 48 platform_window()->ConfineCursorToBounds(confined_bounds); |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 void AshWindowTreeHostPlatform::UnConfineCursor() { | 52 void AshWindowTreeHostPlatform::UnConfineCursor() { |
53 NOTIMPLEMENTED(); | 53 NOTIMPLEMENTED(); |
54 } | 54 } |
55 | 55 |
56 void AshWindowTreeHostPlatform::SetRootWindowTransformer( | 56 void AshWindowTreeHostPlatform::SetRootWindowTransformer( |
57 scoped_ptr<RootWindowTransformer> transformer) { | 57 std::unique_ptr<RootWindowTransformer> transformer) { |
58 transformer_helper_.SetRootWindowTransformer(std::move(transformer)); | 58 transformer_helper_.SetRootWindowTransformer(std::move(transformer)); |
59 ConfineCursorToRootWindow(); | 59 ConfineCursorToRootWindow(); |
60 } | 60 } |
61 | 61 |
62 gfx::Insets AshWindowTreeHostPlatform::GetHostInsets() const { | 62 gfx::Insets AshWindowTreeHostPlatform::GetHostInsets() const { |
63 return transformer_helper_.GetHostInsets(); | 63 return transformer_helper_.GetHostInsets(); |
64 } | 64 } |
65 | 65 |
66 aura::WindowTreeHost* AshWindowTreeHostPlatform::AsWindowTreeHost() { | 66 aura::WindowTreeHost* AshWindowTreeHostPlatform::AsWindowTreeHost() { |
67 return this; | 67 return this; |
68 } | 68 } |
69 | 69 |
70 void AshWindowTreeHostPlatform::PrepareForShutdown() { | 70 void AshWindowTreeHostPlatform::PrepareForShutdown() { |
71 // Block the root window from dispatching events because it is weird for a | 71 // Block the root window from dispatching events because it is weird for a |
72 // ScreenPositionClient not to be attached to the root window and for | 72 // ScreenPositionClient not to be attached to the root window and for |
73 // ui::EventHandlers to be unable to convert the event's location to screen | 73 // ui::EventHandlers to be unable to convert the event's location to screen |
74 // coordinates. | 74 // coordinates. |
75 window()->SetEventTargeter( | 75 window()->SetEventTargeter( |
76 scoped_ptr<ui::EventTargeter>(new ui::NullEventTargeter)); | 76 std::unique_ptr<ui::EventTargeter>(new ui::NullEventTargeter)); |
77 } | 77 } |
78 | 78 |
79 void AshWindowTreeHostPlatform::SetRootTransform( | 79 void AshWindowTreeHostPlatform::SetRootTransform( |
80 const gfx::Transform& transform) { | 80 const gfx::Transform& transform) { |
81 transformer_helper_.SetTransform(transform); | 81 transformer_helper_.SetTransform(transform); |
82 } | 82 } |
83 | 83 |
84 gfx::Transform AshWindowTreeHostPlatform::GetRootTransform() const { | 84 gfx::Transform AshWindowTreeHostPlatform::GetRootTransform() const { |
85 return transformer_helper_.GetTransform(); | 85 return transformer_helper_.GetTransform(); |
86 } | 86 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 #if defined(USE_OZONE) | 124 #if defined(USE_OZONE) |
125 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); | 125 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); |
126 | 126 |
127 // Temporarily pause tap-to-click when the cursor is hidden. | 127 // Temporarily pause tap-to-click when the cursor is hidden. |
128 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( | 128 ui::OzonePlatform::GetInstance()->GetInputController()->SetTapToClickPaused( |
129 state); | 129 state); |
130 #endif | 130 #endif |
131 } | 131 } |
132 | 132 |
133 } // namespace ash | 133 } // namespace ash |
OLD | NEW |