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 |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
13 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
14 #include "ui/aura/client/capture_client.h" | 14 #include "ui/aura/client/capture_client.h" |
15 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
16 #include "ui/base/cursor/cursor_loader_win.h" | 16 #include "ui/base/cursor/cursor_loader_win.h" |
17 #include "ui/base/events/event.h" | 17 #include "ui/base/events/event.h" |
18 #include "ui/base/events/event_utils.h" | 18 #include "ui/base/events/event_utils.h" |
19 #include "ui/base/keycodes/keyboard_code_conversion_win.h" | 19 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
20 #include "ui/base/view_prop.h" | 20 #include "ui/base/view_prop.h" |
| 21 #include "ui/gfx/insets.h" |
21 #include "ui/metro_viewer/metro_viewer_messages.h" | 22 #include "ui/metro_viewer/metro_viewer_messages.h" |
22 | 23 |
23 namespace aura { | 24 namespace aura { |
24 | 25 |
25 namespace { | 26 namespace { |
26 | 27 |
27 const char* kRootWindowHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; | 28 const char* kRootWindowHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; |
28 | 29 |
29 // The touch id to be used for touch events coming in from Windows Ash. | 30 // The touch id to be used for touch events coming in from Windows Ash. |
30 const int kRemoteWindowTouchId = 10; | 31 const int kRemoteWindowTouchId = 10; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 240 |
240 gfx::Rect RemoteRootWindowHostWin::GetBounds() const { | 241 gfx::Rect RemoteRootWindowHostWin::GetBounds() const { |
241 gfx::Rect r(gfx::Point(0, 0), aura::RootWindowHost::GetNativeScreenSize()); | 242 gfx::Rect r(gfx::Point(0, 0), aura::RootWindowHost::GetNativeScreenSize()); |
242 return r; | 243 return r; |
243 } | 244 } |
244 | 245 |
245 void RemoteRootWindowHostWin::SetBounds(const gfx::Rect& bounds) { | 246 void RemoteRootWindowHostWin::SetBounds(const gfx::Rect& bounds) { |
246 delegate_->OnHostResized(bounds.size()); | 247 delegate_->OnHostResized(bounds.size()); |
247 } | 248 } |
248 | 249 |
| 250 gfx::Insets RemoteRootWindowHostWin::GetInsets() const { |
| 251 return gfx::Insets(); |
| 252 } |
| 253 |
| 254 void RemoteRootWindowHostWin::SetInsets(const gfx::Insets& insets) { |
| 255 } |
| 256 |
249 gfx::Point RemoteRootWindowHostWin::GetLocationOnNativeScreen() const { | 257 gfx::Point RemoteRootWindowHostWin::GetLocationOnNativeScreen() const { |
250 return gfx::Point(0, 0); | 258 return gfx::Point(0, 0); |
251 } | 259 } |
252 | 260 |
253 void RemoteRootWindowHostWin::SetCursor(gfx::NativeCursor native_cursor) { | 261 void RemoteRootWindowHostWin::SetCursor(gfx::NativeCursor native_cursor) { |
254 if (!host_) | 262 if (!host_) |
255 return; | 263 return; |
256 host_->Send( | 264 host_->Send( |
257 new MetroViewerHostMsg_SetCursor(uint64(native_cursor.platform()))); | 265 new MetroViewerHostMsg_SetCursor(uint64(native_cursor.platform()))); |
258 } | 266 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } else { | 445 } else { |
438 ui::KeyEvent event(type, | 446 ui::KeyEvent event(type, |
439 ui::KeyboardCodeForWindowsKeyCode(vkey), | 447 ui::KeyboardCodeForWindowsKeyCode(vkey), |
440 flags, | 448 flags, |
441 is_character); | 449 is_character); |
442 delegate_->OnHostKeyEvent(&event); | 450 delegate_->OnHostKeyEvent(&event); |
443 } | 451 } |
444 } | 452 } |
445 | 453 |
446 } // namespace aura | 454 } // namespace aura |
OLD | NEW |