OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TEST_ENV_TEST_HELPER_H_ | 5 #ifndef UI_AURA_TEST_ENV_TEST_HELPER_H_ |
6 #define UI_AURA_TEST_ENV_TEST_HELPER_H_ | 6 #define UI_AURA_TEST_ENV_TEST_HELPER_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
12 #include "ui/aura/input_state_lookup.h" | 12 #include "ui/aura/input_state_lookup.h" |
13 | 13 |
14 namespace aura { | 14 namespace aura { |
15 namespace test { | 15 namespace test { |
16 | 16 |
17 class EnvTestHelper { | 17 class EnvTestHelper { |
18 public: | 18 public: |
19 explicit EnvTestHelper(Env* env) : env_(env) {} | 19 explicit EnvTestHelper(Env* env) : env_(env) {} |
20 ~EnvTestHelper() {} | 20 ~EnvTestHelper() {} |
21 | 21 |
22 void SetInputStateLookup(scoped_ptr<InputStateLookup> input_state_lookup) { | 22 void SetInputStateLookup( |
| 23 std::unique_ptr<InputStateLookup> input_state_lookup) { |
23 env_->input_state_lookup_ = std::move(input_state_lookup); | 24 env_->input_state_lookup_ = std::move(input_state_lookup); |
24 } | 25 } |
25 | 26 |
26 void ResetEventState() { | 27 void ResetEventState() { |
27 env_->mouse_button_flags_ = 0; | 28 env_->mouse_button_flags_ = 0; |
28 env_->is_touch_down_ = false; | 29 env_->is_touch_down_ = false; |
29 } | 30 } |
30 | 31 |
31 private: | 32 private: |
32 Env* env_; | 33 Env* env_; |
33 | 34 |
34 DISALLOW_COPY_AND_ASSIGN(EnvTestHelper); | 35 DISALLOW_COPY_AND_ASSIGN(EnvTestHelper); |
35 }; | 36 }; |
36 | 37 |
37 } // namespace test | 38 } // namespace test |
38 } // namespace aura | 39 } // namespace aura |
39 | 40 |
40 #endif // UI_AURA_TEST_ENV_TEST_HELPER_H_ | 41 #endif // UI_AURA_TEST_ENV_TEST_HELPER_H_ |
OLD | NEW |