OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ASH_HOST_ASH_WINDOW_TREE_HOST_H_ | 5 #ifndef ASH_HOST_ASH_WINDOW_TREE_HOST_H_ |
6 #define ASH_HOST_ASH_WINDOW_TREE_HOST_H_ | 6 #define ASH_HOST_ASH_WINDOW_TREE_HOST_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/callback_forward.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 | 11 |
11 namespace aura { | 12 namespace aura { |
12 class Window; | 13 class Window; |
13 class WindowTreeHost; | 14 class WindowTreeHost; |
14 } | 15 } |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 class Insets; | 18 class Insets; |
18 class Rect; | 19 class Rect; |
19 } | 20 } |
20 | 21 |
21 namespace ui { | 22 namespace ui { |
22 class EventSource; | 23 class EventSource; |
23 class KeyEvent; | 24 class KeyEvent; |
24 class LocatedEvent; | 25 class LocatedEvent; |
25 } | 26 } |
26 | 27 |
27 namespace ash { | 28 namespace ash { |
28 struct AshWindowTreeHostInitParams; | 29 struct AshWindowTreeHostInitParams; |
29 class InputMethodEventHandler; | 30 class InputMethodEventHandler; |
30 class RootWindowTransformer; | 31 class RootWindowTransformer; |
31 | 32 |
32 class ASH_EXPORT AshWindowTreeHost { | 33 class ASH_EXPORT AshWindowTreeHost { |
33 public: | 34 public: |
| 35 using Factory = |
| 36 base::Callback<AshWindowTreeHost*(const AshWindowTreeHostInitParams&)>; |
34 AshWindowTreeHost(); | 37 AshWindowTreeHost(); |
35 virtual ~AshWindowTreeHost() {} | 38 virtual ~AshWindowTreeHost() {} |
36 | 39 |
37 // Creates a new AshWindowTreeHost. The caller owns the returned value. | 40 // Creates a new AshWindowTreeHost. The caller owns the returned value. |
38 static AshWindowTreeHost* Create( | 41 static AshWindowTreeHost* Create( |
39 const AshWindowTreeHostInitParams& init_params); | 42 const AshWindowTreeHostInitParams& init_params); |
| 43 static void SetFactory(const Factory& factory); |
40 | 44 |
41 void set_input_method_handler(InputMethodEventHandler* input_method_handler) { | 45 void set_input_method_handler(InputMethodEventHandler* input_method_handler) { |
42 input_method_handler_ = input_method_handler; | 46 input_method_handler_ = input_method_handler; |
43 } | 47 } |
44 | 48 |
45 InputMethodEventHandler* input_method_handler() { | 49 InputMethodEventHandler* input_method_handler() { |
46 return input_method_handler_; | 50 return input_method_handler_; |
47 } | 51 } |
48 | 52 |
49 // Toggles the host's full screen state. | 53 // Toggles the host's full screen state. |
(...skipping 23 matching lines...) Expand all Loading... |
73 // Translates the native mouse location into screen coordinates. | 77 // Translates the native mouse location into screen coordinates. |
74 void TranslateLocatedEvent(ui::LocatedEvent* event); | 78 void TranslateLocatedEvent(ui::LocatedEvent* event); |
75 | 79 |
76 private: | 80 private: |
77 InputMethodEventHandler* input_method_handler_; | 81 InputMethodEventHandler* input_method_handler_; |
78 }; | 82 }; |
79 | 83 |
80 } // namespace ash | 84 } // namespace ash |
81 | 85 |
82 #endif // ASH_HOST_ASH_WINDOW_TREE_HOST_H_ | 86 #endif // ASH_HOST_ASH_WINDOW_TREE_HOST_H_ |
OLD | NEW |