| 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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class Size; | 27 class Size; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace ui { | 30 namespace ui { |
| 31 class ContextFactory; | 31 class ContextFactory; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace wm { | 34 namespace wm { |
| 35 | 35 |
| 36 class CompoundEventFilter; | 36 class CompoundEventFilter; |
| 37 class WMState; |
| 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::WindowParentingClient { | 42 class WMTestHelper : public aura::client::WindowParentingClient { |
| 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 host_.get(); } |
| 48 | 49 |
| 49 // Overridden from client::WindowParentingClient: | 50 // Overridden from client::WindowParentingClient: |
| 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: |
| 56 std::unique_ptr<WMState> wm_state_; |
| 55 std::unique_ptr<aura::WindowTreeHost> host_; | 57 std::unique_ptr<aura::WindowTreeHost> host_; |
| 56 std::unique_ptr<aura::InputMethodGlue> input_method_glue_; | 58 std::unique_ptr<aura::InputMethodGlue> input_method_glue_; |
| 57 std::unique_ptr<wm::CompoundEventFilter> root_window_event_filter_; | 59 std::unique_ptr<wm::CompoundEventFilter> root_window_event_filter_; |
| 58 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; | 60 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; |
| 59 std::unique_ptr<aura::client::FocusClient> focus_client_; | 61 std::unique_ptr<aura::client::FocusClient> focus_client_; |
| 60 | 62 |
| 61 DISALLOW_COPY_AND_ASSIGN(WMTestHelper); | 63 DISALLOW_COPY_AND_ASSIGN(WMTestHelper); |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 } // namespace wm | 66 } // namespace wm |
| 65 | 67 |
| 66 #endif // UI_WM_TEST_WM_TEST_HELPER_H_ | 68 #endif // UI_WM_TEST_WM_TEST_HELPER_H_ |
| OLD | NEW |