| 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_root_window_host_win.h" | 5 #include "ui/aura/remote_root_window_host_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 RemoteRootWindowHostWin* RemoteRootWindowHostWin::Create( | 127 RemoteRootWindowHostWin* RemoteRootWindowHostWin::Create( |
| 128 const gfx::Rect& bounds) { | 128 const gfx::Rect& bounds) { |
| 129 g_instance = g_instance ? g_instance : new RemoteRootWindowHostWin(bounds); | 129 g_instance = g_instance ? g_instance : new RemoteRootWindowHostWin(bounds); |
| 130 return g_instance; | 130 return g_instance; |
| 131 } | 131 } |
| 132 | 132 |
| 133 RemoteRootWindowHostWin::RemoteRootWindowHostWin(const gfx::Rect& bounds) | 133 RemoteRootWindowHostWin::RemoteRootWindowHostWin(const gfx::Rect& bounds) |
| 134 : remote_window_(NULL), | 134 : remote_window_(NULL), |
| 135 host_(NULL), | 135 host_(NULL), |
| 136 ignore_mouse_moves_until_set_cursor_ack_(false), | 136 ignore_mouse_moves_until_set_cursor_ack_(false), |
| 137 event_flags_(0) { | 137 event_flags_(0), |
| 138 window_size_(aura::RootWindowHost::GetNativeScreenSize()) { |
| 138 prop_.reset(new ui::ViewProp(NULL, kRootWindowHostWinKey, this)); | 139 prop_.reset(new ui::ViewProp(NULL, kRootWindowHostWinKey, this)); |
| 139 } | 140 } |
| 140 | 141 |
| 141 RemoteRootWindowHostWin::~RemoteRootWindowHostWin() { | 142 RemoteRootWindowHostWin::~RemoteRootWindowHostWin() { |
| 142 g_instance = NULL; | 143 g_instance = NULL; |
| 143 } | 144 } |
| 144 | 145 |
| 145 void RemoteRootWindowHostWin::Connected(IPC::Sender* host, HWND remote_window) { | 146 void RemoteRootWindowHostWin::Connected(IPC::Sender* host, HWND remote_window) { |
| 146 CHECK(host_ == NULL); | 147 CHECK(host_ == NULL); |
| 147 host_ = host; | 148 host_ = host; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 318 } |
| 318 | 319 |
| 319 void RemoteRootWindowHostWin::Hide() { | 320 void RemoteRootWindowHostWin::Hide() { |
| 320 NOTIMPLEMENTED(); | 321 NOTIMPLEMENTED(); |
| 321 } | 322 } |
| 322 | 323 |
| 323 void RemoteRootWindowHostWin::ToggleFullScreen() { | 324 void RemoteRootWindowHostWin::ToggleFullScreen() { |
| 324 } | 325 } |
| 325 | 326 |
| 326 gfx::Rect RemoteRootWindowHostWin::GetBounds() const { | 327 gfx::Rect RemoteRootWindowHostWin::GetBounds() const { |
| 327 gfx::Rect r(gfx::Point(0, 0), aura::RootWindowHost::GetNativeScreenSize()); | 328 return gfx::Rect(window_size_); |
| 328 return r; | |
| 329 } | 329 } |
| 330 | 330 |
| 331 void RemoteRootWindowHostWin::SetBounds(const gfx::Rect& bounds) { | 331 void RemoteRootWindowHostWin::SetBounds(const gfx::Rect& bounds) { |
| 332 window_size_ = bounds.size(); |
| 332 delegate_->OnHostResized(bounds.size()); | 333 delegate_->OnHostResized(bounds.size()); |
| 333 } | 334 } |
| 334 | 335 |
| 335 gfx::Insets RemoteRootWindowHostWin::GetInsets() const { | 336 gfx::Insets RemoteRootWindowHostWin::GetInsets() const { |
| 336 return gfx::Insets(); | 337 return gfx::Insets(); |
| 337 } | 338 } |
| 338 | 339 |
| 339 void RemoteRootWindowHostWin::SetInsets(const gfx::Insets& insets) { | 340 void RemoteRootWindowHostWin::SetInsets(const gfx::Insets& insets) { |
| 340 } | 341 } |
| 341 | 342 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 606 } |
| 606 | 607 |
| 607 void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { | 608 void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { |
| 608 if (flags == event_flags_) | 609 if (flags == event_flags_) |
| 609 return; | 610 return; |
| 610 event_flags_ = flags; | 611 event_flags_ = flags; |
| 611 SetVirtualKeyStates(event_flags_); | 612 SetVirtualKeyStates(event_flags_); |
| 612 } | 613 } |
| 613 | 614 |
| 614 } // namespace aura | 615 } // namespace aura |
| OLD | NEW |