Roll src/third_party/WebKit 9301d6f:4619053 (svn 201058:201059)
[chromium-blink-merge.git] / ash / host / ash_window_tree_host.h
blob54724aa5fcf9224d43fdba04e571375d7ff004b0
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"
11 namespace aura {
12 class Window;
13 class WindowTreeHost;
16 namespace gfx {
17 class Insets;
18 class Rect;
21 namespace ui {
22 class EventSource;
23 class KeyEvent;
24 class LocatedEvent;
27 namespace ash {
28 struct AshWindowTreeHostInitParams;
29 class InputMethodEventHandler;
30 class RootWindowTransformer;
32 class ASH_EXPORT AshWindowTreeHost {
33 public:
34 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) {}
72 protected:
73 // Translates the native mouse location into screen coordinates.
74 void TranslateLocatedEvent(ui::LocatedEvent* event);
76 private:
77 InputMethodEventHandler* input_method_handler_;
80 } // namespace ash
82 #endif // ASH_HOST_ASH_WINDOW_TREE_HOST_H_