| 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_WM_TEST_WM_TEST_HELPER_H_ | 5 #ifndef UI_WM_TEST_WM_TEST_HELPER_H_ |
| 6 #define UI_WM_TEST_WM_TEST_HELPER_H_ | 6 #define UI_WM_TEST_WM_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/aura/client/window_tree_client.h" | 12 #include "ui/aura/client/window_tree_client.h" |
| 13 #include "ui/aura/test/test_screen.h" |
| 13 #include "ui/aura/window_tree_host.h" | 14 #include "ui/aura/window_tree_host.h" |
| 14 | 15 |
| 15 namespace aura { | 16 namespace aura { |
| 16 class InputMethodGlue; | 17 class InputMethodGlue; |
| 17 class Window; | 18 class Window; |
| 18 class WindowTreeHost; | 19 class WindowTreeHost; |
| 19 namespace client { | 20 namespace client { |
| 20 class DefaultCaptureClient; | 21 class DefaultCaptureClient; |
| 21 class FocusClient; | 22 class FocusClient; |
| 22 } | 23 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 37 | 38 |
| 38 // Creates a minimal environment for running the shell. We can't pull in all of | 39 // Creates a minimal environment for running the shell. We can't pull in all of |
| 39 // ash here, but we can create attach several of the same things we'd find in | 40 // ash here, but we can create attach several of the same things we'd find in |
| 40 // the ash parts of the code. | 41 // the ash parts of the code. |
| 41 class WMTestHelper : public aura::client::WindowTreeClient { | 42 class WMTestHelper : public aura::client::WindowTreeClient { |
| 42 public: | 43 public: |
| 43 WMTestHelper(const gfx::Size& default_window_size, | 44 WMTestHelper(const gfx::Size& default_window_size, |
| 44 ui::ContextFactory* context_factory); | 45 ui::ContextFactory* context_factory); |
| 45 ~WMTestHelper() override; | 46 ~WMTestHelper() override; |
| 46 | 47 |
| 47 aura::WindowTreeHost* host() { return host_.get(); } | 48 aura::WindowTreeHost* host() { return test_screen_->host(); } |
| 48 | 49 |
| 49 // Overridden from client::WindowTreeClient: | 50 // Overridden from client::WindowTreeClient: |
| 50 aura::Window* GetDefaultParent(aura::Window* context, | 51 aura::Window* GetDefaultParent(aura::Window* context, |
| 51 aura::Window* window, | 52 aura::Window* window, |
| 52 const gfx::Rect& bounds) override; | 53 const gfx::Rect& bounds) override; |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 std::unique_ptr<aura::WindowTreeHost> host_; | 56 std::unique_ptr<aura::TestScreen> test_screen_; |
| 56 std::unique_ptr<aura::InputMethodGlue> input_method_glue_; | 57 std::unique_ptr<aura::InputMethodGlue> input_method_glue_; |
| 57 std::unique_ptr<wm::CompoundEventFilter> root_window_event_filter_; | 58 std::unique_ptr<wm::CompoundEventFilter> root_window_event_filter_; |
| 58 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; | 59 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; |
| 59 std::unique_ptr<aura::client::FocusClient> focus_client_; | 60 std::unique_ptr<aura::client::FocusClient> focus_client_; |
| 60 | 61 |
| 61 DISALLOW_COPY_AND_ASSIGN(WMTestHelper); | 62 DISALLOW_COPY_AND_ASSIGN(WMTestHelper); |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace wm | 65 } // namespace wm |
| 65 | 66 |
| 66 #endif // UI_WM_TEST_WM_TEST_HELPER_H_ | 67 #endif // UI_WM_TEST_WM_TEST_HELPER_H_ |
| OLD | NEW |