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