summaryrefslogtreecommitdiffstats
path: root/ash/host/ash_remote_window_tree_host_win.cc
blob: f3191b5eda025a7b7d9fdeca211cd7d1b07224e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/host/ash_remote_window_tree_host_win.h"

#include "ash/host/root_window_transformer.h"
#include "ash/ime/input_method_event_handler.h"
#include "ui/events/event_processor.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/transform.h"

namespace ash {

AshRemoteWindowTreeHostWin::AshRemoteWindowTreeHostWin(HWND remote_hwnd)
    : aura::RemoteWindowTreeHostWin(),
      transformer_helper_(this) {
  SetRemoteWindowHandle(remote_hwnd);
  transformer_helper_.Init();
}

AshRemoteWindowTreeHostWin::~AshRemoteWindowTreeHostWin() {}

void AshRemoteWindowTreeHostWin::ToggleFullScreen() {}

bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; }

void AshRemoteWindowTreeHostWin::UnConfineCursor() {}

void AshRemoteWindowTreeHostWin::SetRootWindowTransformer(
    scoped_ptr<RootWindowTransformer> transformer) {
  transformer_helper_.SetRootWindowTransformer(transformer.Pass());
}

gfx::Insets AshRemoteWindowTreeHostWin::GetHostInsets() const {
  return gfx::Insets();
}

aura::WindowTreeHost* AshRemoteWindowTreeHostWin::AsWindowTreeHost() {
  return this;
}

gfx::Transform AshRemoteWindowTreeHostWin::GetRootTransform() const {
  return transformer_helper_.GetTransform();
}

void AshRemoteWindowTreeHostWin::SetRootTransform(
    const gfx::Transform& transform) {
  transformer_helper_.SetTransform(transform);
}

gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const {
  return transformer_helper_.GetInverseTransform();
}

void AshRemoteWindowTreeHostWin::UpdateRootWindowSize(
    const gfx::Size& host_size) {
  transformer_helper_.UpdateWindowSize(host_size);
}

ui::EventDispatchDetails AshRemoteWindowTreeHostWin::DispatchKeyEventPostIME(
    ui::KeyEvent* event) {
  input_method_handler()->SetPostIME(true);
  ui::EventDispatchDetails details =
      event_processor()->OnEventFromSource(event);
  if (!details.dispatcher_destroyed)
    input_method_handler()->SetPostIME(false);
  return details;
}

}  // namespace ash