Roll src/third_party/skia 1052f51:2440fcd
[chromium-blink-merge.git] / ash / host / ash_remote_window_tree_host_win.cc
blobf3191b5eda025a7b7d9fdeca211cd7d1b07224e6
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 #include "ash/host/ash_remote_window_tree_host_win.h"
7 #include "ash/host/root_window_transformer.h"
8 #include "ash/ime/input_method_event_handler.h"
9 #include "ui/events/event_processor.h"
10 #include "ui/gfx/geometry/insets.h"
11 #include "ui/gfx/transform.h"
13 namespace ash {
15 AshRemoteWindowTreeHostWin::AshRemoteWindowTreeHostWin(HWND remote_hwnd)
16 : aura::RemoteWindowTreeHostWin(),
17 transformer_helper_(this) {
18 SetRemoteWindowHandle(remote_hwnd);
19 transformer_helper_.Init();
22 AshRemoteWindowTreeHostWin::~AshRemoteWindowTreeHostWin() {}
24 void AshRemoteWindowTreeHostWin::ToggleFullScreen() {}
26 bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; }
28 void AshRemoteWindowTreeHostWin::UnConfineCursor() {}
30 void AshRemoteWindowTreeHostWin::SetRootWindowTransformer(
31 scoped_ptr<RootWindowTransformer> transformer) {
32 transformer_helper_.SetRootWindowTransformer(transformer.Pass());
35 gfx::Insets AshRemoteWindowTreeHostWin::GetHostInsets() const {
36 return gfx::Insets();
39 aura::WindowTreeHost* AshRemoteWindowTreeHostWin::AsWindowTreeHost() {
40 return this;
43 gfx::Transform AshRemoteWindowTreeHostWin::GetRootTransform() const {
44 return transformer_helper_.GetTransform();
47 void AshRemoteWindowTreeHostWin::SetRootTransform(
48 const gfx::Transform& transform) {
49 transformer_helper_.SetTransform(transform);
52 gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const {
53 return transformer_helper_.GetInverseTransform();
56 void AshRemoteWindowTreeHostWin::UpdateRootWindowSize(
57 const gfx::Size& host_size) {
58 transformer_helper_.UpdateWindowSize(host_size);
61 ui::EventDispatchDetails AshRemoteWindowTreeHostWin::DispatchKeyEventPostIME(
62 ui::KeyEvent* event) {
63 input_method_handler()->SetPostIME(true);
64 ui::EventDispatchDetails details =
65 event_processor()->OnEventFromSource(event);
66 if (!details.dispatcher_destroyed)
67 input_method_handler()->SetPostIME(false);
68 return details;
71 } // namespace ash