| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/host/ash_remote_window_tree_host_win.h" | 5 #include "ash/host/ash_remote_window_tree_host_win.h" |
| 6 | 6 |
| 7 #include "ash/host/root_window_transformer.h" | 7 #include "ash/host/root_window_transformer.h" |
| 8 #include "ui/gfx/geometry/insets.h" | 8 #include "ui/gfx/geometry/insets.h" |
| 9 #include "ui/gfx/transform.h" | 9 #include "ui/gfx/transform.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace { | 12 |
| 13 AshRemoteWindowTreeHostWin* g_instance = NULL; | 13 AshRemoteWindowTreeHostWin::AshRemoteWindowTreeHostWin(HWND remote_hwnd) |
| 14 : aura::RemoteWindowTreeHostWin(), |
| 15 transformer_helper_(this) { |
| 16 SetRemoteWindowHandle(remote_hwnd); |
| 14 } | 17 } |
| 15 | 18 |
| 16 // static | 19 AshRemoteWindowTreeHostWin::~AshRemoteWindowTreeHostWin() {} |
| 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 | 20 |
| 39 void AshRemoteWindowTreeHostWin::ToggleFullScreen() {} | 21 void AshRemoteWindowTreeHostWin::ToggleFullScreen() {} |
| 40 | 22 |
| 41 bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; } | 23 bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; } |
| 42 | 24 |
| 43 void AshRemoteWindowTreeHostWin::UnConfineCursor() {} | 25 void AshRemoteWindowTreeHostWin::UnConfineCursor() {} |
| 44 | 26 |
| 45 void AshRemoteWindowTreeHostWin::SetRootWindowTransformer( | 27 void AshRemoteWindowTreeHostWin::SetRootWindowTransformer( |
| 46 scoped_ptr<RootWindowTransformer> transformer) { | 28 scoped_ptr<RootWindowTransformer> transformer) { |
| 47 transformer_helper_.SetRootWindowTransformer(transformer.Pass()); | 29 transformer_helper_.SetRootWindowTransformer(transformer.Pass()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const { | 49 gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const { |
| 68 return transformer_helper_.GetInverseTransform(); | 50 return transformer_helper_.GetInverseTransform(); |
| 69 } | 51 } |
| 70 | 52 |
| 71 void AshRemoteWindowTreeHostWin::UpdateRootWindowSize( | 53 void AshRemoteWindowTreeHostWin::UpdateRootWindowSize( |
| 72 const gfx::Size& host_size) { | 54 const gfx::Size& host_size) { |
| 73 transformer_helper_.UpdateWindowSize(host_size); | 55 transformer_helper_.UpdateWindowSize(host_size); |
| 74 } | 56 } |
| 75 | 57 |
| 76 } // namespace ash | 58 } // namespace ash |
| OLD | NEW |