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 "win8/metro_driver/stdafx.h" | 5 #include "win8/metro_driver/stdafx.h" |
6 #include "win8/metro_driver/chrome_app_view_ash.h" | 6 #include "win8/metro_driver/chrome_app_view_ash.h" |
7 | 7 |
8 #include <corewindow.h> | 8 #include <corewindow.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <windows.foundation.h> | 10 #include <windows.foundation.h> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "base/win/metro.h" | 18 #include "base/win/metro.h" |
19 #include "base/win/win_util.h" | 19 #include "base/win/win_util.h" |
20 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
22 #include "ipc/ipc_channel.h" | 22 #include "ipc/ipc_channel.h" |
23 #include "ipc/ipc_channel_proxy.h" | 23 #include "ipc/ipc_channel_proxy.h" |
24 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
25 #include "ui/events/gestures/gesture_sequence.h" | 25 #include "ui/events/gesture_detection/motion_event.h" |
26 #include "ui/gfx/geometry/point_conversions.h" | 26 #include "ui/gfx/geometry/point_conversions.h" |
27 #include "ui/gfx/win/dpi.h" | 27 #include "ui/gfx/win/dpi.h" |
28 #include "ui/metro_viewer/metro_viewer_messages.h" | 28 #include "ui/metro_viewer/metro_viewer_messages.h" |
29 #include "win8/metro_driver/file_picker_ash.h" | 29 #include "win8/metro_driver/file_picker_ash.h" |
30 #include "win8/metro_driver/ime/ime_popup_monitor.h" | 30 #include "win8/metro_driver/ime/ime_popup_monitor.h" |
31 #include "win8/metro_driver/ime/input_source.h" | 31 #include "win8/metro_driver/ime/input_source.h" |
32 #include "win8/metro_driver/ime/text_service.h" | 32 #include "win8/metro_driver/ime/text_service.h" |
33 #include "win8/metro_driver/metro_driver.h" | 33 #include "win8/metro_driver/metro_driver.h" |
34 #include "win8/metro_driver/winrt_utils.h" | 34 #include "win8/metro_driver/winrt_utils.h" |
35 #include "win8/viewer/metro_viewer_constants.h" | 35 #include "win8/viewer/metro_viewer_constants.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 gfx::Point dip_point_win32 = | 412 gfx::Point dip_point_win32 = |
413 gfx::ToCeiledPoint(gfx::ScalePoint(scaled_point_metro, | 413 gfx::ToCeiledPoint(gfx::ScalePoint(scaled_point_metro, |
414 1.0 / win32_dpi_scale_)); | 414 1.0 / win32_dpi_scale_)); |
415 x_ = dip_point_win32.x(); | 415 x_ = dip_point_win32.x(); |
416 y_ = dip_point_win32.y(); | 416 y_ = dip_point_win32.y(); |
417 | 417 |
418 pointer_point_->get_Timestamp(×tamp_); | 418 pointer_point_->get_Timestamp(×tamp_); |
419 pointer_point_->get_PointerId(&pointer_id_); | 419 pointer_point_->get_PointerId(&pointer_id_); |
420 // Map the OS touch event id to a range allowed by the gesture recognizer. | 420 // Map the OS touch event id to a range allowed by the gesture recognizer. |
421 if (IsTouch()) | 421 if (IsTouch()) |
422 pointer_id_ %= ui::GestureSequence::kMaxGesturePoints; | 422 pointer_id_ %= ui::MotionEvent::MAX_TOUCH_POINT_COUNT; |
423 | 423 |
424 boolean left_button_state; | 424 boolean left_button_state; |
425 hr = properties->get_IsLeftButtonPressed(&left_button_state); | 425 hr = properties->get_IsLeftButtonPressed(&left_button_state); |
426 if (FAILED(hr)) | 426 if (FAILED(hr)) |
427 return hr; | 427 return hr; |
428 if (left_button_state) | 428 if (left_button_state) |
429 mouse_down_flags_ |= ui::EF_LEFT_MOUSE_BUTTON; | 429 mouse_down_flags_ |= ui::EF_LEFT_MOUSE_BUTTON; |
430 | 430 |
431 boolean right_button_state; | 431 boolean right_button_state; |
432 hr = properties->get_IsRightButtonPressed(&right_button_state); | 432 hr = properties->get_IsRightButtonPressed(&right_button_state); |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1390 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
1391 CheckHR(core_app.As(&app_exit)); | 1391 CheckHR(core_app.As(&app_exit)); |
1392 globals.app_exit = app_exit.Detach(); | 1392 globals.app_exit = app_exit.Detach(); |
1393 } | 1393 } |
1394 | 1394 |
1395 IFACEMETHODIMP | 1395 IFACEMETHODIMP |
1396 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1396 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
1397 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1397 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
1398 return (*view) ? S_OK : E_OUTOFMEMORY; | 1398 return (*view) ? S_OK : E_OUTOFMEMORY; |
1399 } | 1399 } |
OLD | NEW |