| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/remote_window_tree_host_win.h" | 5 #include "ui/aura/remote_window_tree_host_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 DestroyCompositor(); | 176 DestroyCompositor(); |
| 177 DestroyDispatcher(); | 177 DestroyDispatcher(); |
| 178 g_instance = NULL; | 178 g_instance = NULL; |
| 179 } | 179 } |
| 180 | 180 |
| 181 // static | 181 // static |
| 182 bool RemoteWindowTreeHostWin::IsValid() { | 182 bool RemoteWindowTreeHostWin::IsValid() { |
| 183 return Instance()->remote_window_ != NULL; | 183 return Instance()->remote_window_ != NULL; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void RemoteWindowTreeHostWin::SetRemoteWindowHandle(HWND remote_window) { | 186 void RemoteWindowTreeHostWin::InitializeRemoteWindowAndScaleFactor( |
| 187 HWND remote_window, |
| 188 float device_scale) { |
| 187 remote_window_ = remote_window; | 189 remote_window_ = remote_window; |
| 190 gfx::InitDeviceScaleFactor(device_scale); |
| 188 // Do not create compositor here, but in Connected() below. | 191 // Do not create compositor here, but in Connected() below. |
| 189 // See http://crbug.com/330179 and http://crbug.com/334380. | 192 // See http://crbug.com/330179 and http://crbug.com/334380. |
| 190 } | 193 } |
| 191 | 194 |
| 192 void RemoteWindowTreeHostWin::Connected(IPC::Sender* host) { | 195 void RemoteWindowTreeHostWin::Connected(IPC::Sender* host) { |
| 193 CHECK(host_ == NULL); | 196 CHECK(host_ == NULL); |
| 194 DCHECK(remote_window_); | 197 DCHECK(remote_window_); |
| 195 host_ = host; | 198 host_ = host; |
| 196 // Recreate the compositor for the target surface represented by the | 199 // Recreate the compositor for the target surface represented by the |
| 197 // remote_window HWND. | 200 // remote_window HWND. |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 } | 742 } |
| 740 | 743 |
| 741 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { | 744 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { |
| 742 if (flags == event_flags_) | 745 if (flags == event_flags_) |
| 743 return; | 746 return; |
| 744 event_flags_ = flags; | 747 event_flags_ = flags; |
| 745 SetVirtualKeyStates(event_flags_); | 748 SetVirtualKeyStates(event_flags_); |
| 746 } | 749 } |
| 747 | 750 |
| 748 } // namespace aura | 751 } // namespace aura |
| OLD | NEW |