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