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
3 // found in the LICENSE file.
5 #ifndef ASH_HOST_ASH_WINDOW_TREE_HOST_H_
6 #define ASH_HOST_ASH_WINDOW_TREE_HOST_H_
8 #include "ash/ash_export.h"
9 #include "base/memory/scoped_ptr.h"
28 struct AshWindowTreeHostInitParams
;
29 class InputMethodEventHandler
;
30 class RootWindowTransformer
;
32 class ASH_EXPORT AshWindowTreeHost
{
35 virtual ~AshWindowTreeHost() {}
37 // Creates a new AshWindowTreeHost. The caller owns the returned value.
38 static AshWindowTreeHost
* Create(
39 const AshWindowTreeHostInitParams
& init_params
);
41 void set_input_method_handler(InputMethodEventHandler
* input_method_handler
) {
42 input_method_handler_
= input_method_handler
;
45 InputMethodEventHandler
* input_method_handler() {
46 return input_method_handler_
;
49 // Toggles the host's full screen state.
50 virtual void ToggleFullScreen() = 0;
52 // Clips the cursor to the bounds of the root window until UnConfineCursor().
53 // We would like to be able to confine the cursor to that window. However,
54 // currently, we do not have such functionality in X. So we just confine
55 // to the root window. This is ok because this option is currently only
56 // being used in fullscreen mode, so root_window bounds = window bounds.
57 virtual bool ConfineCursorToRootWindow() = 0;
58 virtual void UnConfineCursor() = 0;
60 virtual void SetRootWindowTransformer(
61 scoped_ptr
<RootWindowTransformer
> transformer
) = 0;
63 virtual gfx::Insets
GetHostInsets() const = 0;
65 virtual aura::WindowTreeHost
* AsWindowTreeHost() = 0;
67 // Stop listening for events in preparation for shutdown.
68 virtual void PrepareForShutdown() {}
70 virtual void RegisterMirroringHost(AshWindowTreeHost
* mirroring_ash_host
) {}
73 // Translates the native mouse location into screen coordinates.
74 void TranslateLocatedEvent(ui::LocatedEvent
* event
);
77 InputMethodEventHandler
* input_method_handler_
;
82 #endif // ASH_HOST_ASH_WINDOW_TREE_HOST_H_