| 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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/aura/client/window_tree_client.h" | 10 #include "ui/aura/client/window_tree_client.h" |
| 11 #include "ui/aura/window_tree_host.h" | 11 #include "ui/aura/window_tree_host.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 class Window; | 14 class Window; |
| 15 class WindowTreeHost; | 15 class WindowTreeHost; |
| 16 namespace client { | 16 namespace client { |
| 17 class DefaultActivationClient; | 17 class DefaultActivationClient; |
| 18 class DefaultCaptureClient; | 18 class DefaultCaptureClient; |
| 19 class FocusClient; | 19 class FocusClient; |
| 20 } | 20 } |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace gfx { | 23 namespace gfx { |
| 24 class Rect; | 24 class Rect; |
| 25 class Size; | 25 class Size; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace views { | 28 namespace wm { |
| 29 namespace corewm { | |
| 30 class CompoundEventFilter; | 29 class CompoundEventFilter; |
| 31 class InputMethodEventFilter; | 30 class InputMethodEventFilter; |
| 32 } | 31 } |
| 33 } | |
| 34 | 32 |
| 35 namespace wm { | 33 namespace wm { |
| 36 | 34 |
| 37 // Creates a minimal environment for running the shell. We can't pull in all of | 35 // Creates a minimal environment for running the shell. We can't pull in all of |
| 38 // ash here, but we can create attach several of the same things we'd find in | 36 // ash here, but we can create attach several of the same things we'd find in |
| 39 // the ash parts of the code. | 37 // the ash parts of the code. |
| 40 class WMTestHelper : public aura::client::WindowTreeClient { | 38 class WMTestHelper : public aura::client::WindowTreeClient { |
| 41 public: | 39 public: |
| 42 explicit WMTestHelper(const gfx::Size& default_window_size); | 40 explicit WMTestHelper(const gfx::Size& default_window_size); |
| 43 virtual ~WMTestHelper(); | 41 virtual ~WMTestHelper(); |
| 44 | 42 |
| 45 aura::WindowTreeHost* host() { return host_.get(); } | 43 aura::WindowTreeHost* host() { return host_.get(); } |
| 46 | 44 |
| 47 // Overridden from client::WindowTreeClient: | 45 // Overridden from client::WindowTreeClient: |
| 48 virtual aura::Window* GetDefaultParent(aura::Window* context, | 46 virtual aura::Window* GetDefaultParent(aura::Window* context, |
| 49 aura::Window* window, | 47 aura::Window* window, |
| 50 const gfx::Rect& bounds) OVERRIDE; | 48 const gfx::Rect& bounds) OVERRIDE; |
| 51 | 49 |
| 52 private: | 50 private: |
| 53 scoped_ptr<aura::WindowTreeHost> host_; | 51 scoped_ptr<aura::WindowTreeHost> host_; |
| 54 | 52 |
| 55 // Owned by the root Window. | 53 // Owned by the root Window. |
| 56 views::corewm::CompoundEventFilter* root_window_event_filter_; | 54 wm::CompoundEventFilter* root_window_event_filter_; |
| 57 | 55 |
| 58 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; | 56 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; |
| 59 scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_; | 57 scoped_ptr<wm::InputMethodEventFilter> input_method_filter_; |
| 60 scoped_ptr<aura::client::DefaultActivationClient> activation_client_; | 58 scoped_ptr<aura::client::DefaultActivationClient> activation_client_; |
| 61 scoped_ptr<aura::client::FocusClient> focus_client_; | 59 scoped_ptr<aura::client::FocusClient> focus_client_; |
| 62 | 60 |
| 63 DISALLOW_COPY_AND_ASSIGN(WMTestHelper); | 61 DISALLOW_COPY_AND_ASSIGN(WMTestHelper); |
| 64 }; | 62 }; |
| 65 | 63 |
| 66 } // namespace wm | 64 } // namespace wm |
| 67 | 65 |
| 68 #endif // UI_WM_TEST_WM_TEST_HELPER_H_ | 66 #endif // UI_WM_TEST_WM_TEST_HELPER_H_ |
| OLD | NEW |