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 DCHECK(g_instance); |
| 27 CHECK_EQ(g_instance, aura::RemoteWindowTreeHostWin::Instance()); |
| 28 return g_instance; |
| 29 } |
| 30 |
| 31 AshRemoteWindowTreeHostWin::AshRemoteWindowTreeHostWin() |
| 32 : aura::RemoteWindowTreeHostWin(gfx::Rect()), transformer_helper_(this) { |
| 33 g_instance = this; |
| 34 } |
| 35 |
| 36 AshRemoteWindowTreeHostWin::~AshRemoteWindowTreeHostWin() { g_instance = NULL; } |
| 37 |
| 38 void AshRemoteWindowTreeHostWin::ToggleFullScreen() {} |
| 39 |
| 40 bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; } |
| 41 |
| 42 void AshRemoteWindowTreeHostWin::UnConfineCursor() {} |
| 43 |
| 44 void AshRemoteWindowTreeHostWin::SetRootWindowTransformer( |
| 45 scoped_ptr<RootWindowTransformer> transformer) { |
| 46 transformer_helper_.SetRootWindowTransformer(transformer.Pass()); |
| 47 } |
| 48 |
| 49 aura::WindowTreeHost* AshRemoteWindowTreeHostWin::AsWindowTreeHost() { |
| 50 return this; |
| 51 } |
| 52 |
| 53 gfx::Transform AshRemoteWindowTreeHostWin::GetRootTransform() const { |
| 54 return transformer_helper_.GetTransform(); |
| 55 } |
| 56 |
| 57 void AshRemoteWindowTreeHostWin::SetRootTransform( |
| 58 const gfx::Transform& transform) { |
| 59 transformer_helper_.SetTransform(transform); |
| 60 } |
| 61 |
| 62 gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const { |
| 63 return transformer_helper_.GetInverseTransform(); |
| 64 } |
| 65 |
| 66 void AshRemoteWindowTreeHostWin::UpdateRootWindowSize( |
| 67 const gfx::Size& host_size) { |
| 68 transformer_helper_.UpdateWindowSize(host_size); |
| 69 } |
| 70 |
| 71 } // namespace ash |
OLD | NEW |