OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "ash/host/ash_remote_window_tree_host_win.h" |
| 6 |
| 7 #include "ash/host/root_window_transformer.h" |
| 8 #include "ui/gfx/geometry/insets.h" |
| 9 #include "ui/gfx/transform.h" |
| 10 |
| 11 namespace ash { |
| 12 namespace { |
| 13 AshRemoteWindowTreeHostWin* g_instance = NULL; |
| 14 } |
| 15 |
| 16 // static |
| 17 void AshRemoteWindowTreeHostWin::Init() { |
| 18 DCHECK(!g_instance); |
| 19 g_instance = new AshRemoteWindowTreeHostWin(); |
| 20 aura::RemoteWindowTreeHostWin::SetInstance(g_instance); |
| 21 CHECK_EQ(g_instance, aura::RemoteWindowTreeHostWin::Instance()); |
| 22 } |
| 23 |
| 24 // static |
| 25 AshRemoteWindowTreeHostWin* AshRemoteWindowTreeHostWin::GetInstance() { |
| 26 if (!g_instance) |
| 27 Init(); |
| 28 CHECK_EQ(g_instance, aura::RemoteWindowTreeHostWin::Instance()); |
| 29 return g_instance; |
| 30 } |
| 31 |
| 32 AshRemoteWindowTreeHostWin::AshRemoteWindowTreeHostWin() |
| 33 : aura::RemoteWindowTreeHostWin(gfx::Rect()), transformer_helper_(this) { |
| 34 g_instance = this; |
| 35 } |
| 36 |
| 37 AshRemoteWindowTreeHostWin::~AshRemoteWindowTreeHostWin() { g_instance = NULL; } |
| 38 |
| 39 void AshRemoteWindowTreeHostWin::ToggleFullScreen() {} |
| 40 |
| 41 bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; } |
| 42 |
| 43 void AshRemoteWindowTreeHostWin::UnConfineCursor() {} |
| 44 |
| 45 void AshRemoteWindowTreeHostWin::SetRootWindowTransformer( |
| 46 scoped_ptr<RootWindowTransformer> transformer) { |
| 47 transformer_helper_.SetRootWindowTransformer(transformer.Pass()); |
| 48 } |
| 49 |
| 50 aura::WindowTreeHost* AshRemoteWindowTreeHostWin::AsWindowTreeHost() { |
| 51 return this; |
| 52 } |
| 53 |
| 54 gfx::Transform AshRemoteWindowTreeHostWin::GetRootTransform() const { |
| 55 return transformer_helper_.GetTransform(); |
| 56 } |
| 57 |
| 58 void AshRemoteWindowTreeHostWin::SetRootTransform( |
| 59 const gfx::Transform& transform) { |
| 60 transformer_helper_.SetTransform(transform); |
| 61 } |
| 62 |
| 63 gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const { |
| 64 return transformer_helper_.GetInverseTransform(); |
| 65 } |
| 66 |
| 67 void AshRemoteWindowTreeHostWin::UpdateRootWindowSize( |
| 68 const gfx::Size& host_size) { |
| 69 transformer_helper_.UpdateWindowSize(host_size); |
| 70 } |
| 71 |
| 72 } // namespace ash |
OLD | NEW |