| 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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 namespace aura { | 11 namespace aura { |
| 12 class Window; | 12 class Window; |
| 13 class WindowTreeHost; | 13 class WindowTreeHost; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Insets; | 17 class Insets; |
| 18 class Rect; | 18 class Rect; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace ui { | 21 namespace ui { |
| 22 class EventSource; |
| 23 class KeyEvent; |
| 22 class LocatedEvent; | 24 class LocatedEvent; |
| 23 } | 25 } |
| 24 | 26 |
| 25 namespace ash { | 27 namespace ash { |
| 26 struct AshWindowTreeHostInitParams; | 28 struct AshWindowTreeHostInitParams; |
| 29 class InputMethodEventHandler; |
| 27 class RootWindowTransformer; | 30 class RootWindowTransformer; |
| 28 | 31 |
| 29 class ASH_EXPORT AshWindowTreeHost { | 32 class ASH_EXPORT AshWindowTreeHost { |
| 30 public: | 33 public: |
| 34 AshWindowTreeHost(); |
| 31 virtual ~AshWindowTreeHost() {} | 35 virtual ~AshWindowTreeHost() {} |
| 32 | 36 |
| 33 // Creates a new AshWindowTreeHost. The caller owns the returned value. | 37 // Creates a new AshWindowTreeHost. The caller owns the returned value. |
| 34 static AshWindowTreeHost* Create( | 38 static AshWindowTreeHost* Create( |
| 35 const AshWindowTreeHostInitParams& init_params); | 39 const AshWindowTreeHostInitParams& init_params); |
| 36 | 40 |
| 41 void set_input_method_handler(InputMethodEventHandler* input_method_handler) { |
| 42 input_method_handler_ = input_method_handler; |
| 43 } |
| 44 |
| 45 InputMethodEventHandler* input_method_handler() { |
| 46 return input_method_handler_; |
| 47 } |
| 48 |
| 37 // Toggles the host's full screen state. | 49 // Toggles the host's full screen state. |
| 38 virtual void ToggleFullScreen() = 0; | 50 virtual void ToggleFullScreen() = 0; |
| 39 | 51 |
| 40 // Clips the cursor to the bounds of the root window until UnConfineCursor(). | 52 // Clips the cursor to the bounds of the root window until UnConfineCursor(). |
| 41 // We would like to be able to confine the cursor to that window. However, | 53 // We would like to be able to confine the cursor to that window. However, |
| 42 // currently, we do not have such functionality in X. So we just confine | 54 // currently, we do not have such functionality in X. So we just confine |
| 43 // to the root window. This is ok because this option is currently only | 55 // to the root window. This is ok because this option is currently only |
| 44 // being used in fullscreen mode, so root_window bounds = window bounds. | 56 // being used in fullscreen mode, so root_window bounds = window bounds. |
| 45 virtual bool ConfineCursorToRootWindow() = 0; | 57 virtual bool ConfineCursorToRootWindow() = 0; |
| 46 virtual void UnConfineCursor() = 0; | 58 virtual void UnConfineCursor() = 0; |
| 47 | 59 |
| 48 virtual void SetRootWindowTransformer( | 60 virtual void SetRootWindowTransformer( |
| 49 scoped_ptr<RootWindowTransformer> transformer) = 0; | 61 scoped_ptr<RootWindowTransformer> transformer) = 0; |
| 50 | 62 |
| 51 virtual gfx::Insets GetHostInsets() const = 0; | 63 virtual gfx::Insets GetHostInsets() const = 0; |
| 52 | 64 |
| 53 virtual aura::WindowTreeHost* AsWindowTreeHost() = 0; | 65 virtual aura::WindowTreeHost* AsWindowTreeHost() = 0; |
| 54 | 66 |
| 55 // Stop listening for events in preparation for shutdown. | 67 // Stop listening for events in preparation for shutdown. |
| 56 virtual void PrepareForShutdown() {} | 68 virtual void PrepareForShutdown() {} |
| 57 | 69 |
| 58 virtual void RegisterMirroringHost(AshWindowTreeHost* mirroring_ash_host) {} | 70 virtual void RegisterMirroringHost(AshWindowTreeHost* mirroring_ash_host) {} |
| 59 | 71 |
| 60 protected: | 72 protected: |
| 61 // Translates the native mouse location into screen coordinates. | 73 // Translates the native mouse location into screen coordinates. |
| 62 void TranslateLocatedEvent(ui::LocatedEvent* event); | 74 void TranslateLocatedEvent(ui::LocatedEvent* event); |
| 75 |
| 76 private: |
| 77 InputMethodEventHandler* input_method_handler_; |
| 63 }; | 78 }; |
| 64 | 79 |
| 65 } // namespace ash | 80 } // namespace ash |
| 66 | 81 |
| 67 #endif // ASH_HOST_ASH_WINDOW_TREE_HOST_H_ | 82 #endif // ASH_HOST_ASH_WINDOW_TREE_HOST_H_ |
| OLD | NEW |