| 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> |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 381 |
| 382 is_horizontal_wheel_ = 0; | 382 is_horizontal_wheel_ = 0; |
| 383 properties->get_IsHorizontalMouseWheel(&is_horizontal_wheel_); | 383 properties->get_IsHorizontalMouseWheel(&is_horizontal_wheel_); |
| 384 | 384 |
| 385 // The input coordinates are in DIP based on the metro scale factor. | 385 // The input coordinates are in DIP based on the metro scale factor. |
| 386 // We want to convert it to DIP based on the win32 scale factor. | 386 // We want to convert it to DIP based on the win32 scale factor. |
| 387 // We scale the point by the metro scale factor and then scale down | 387 // We scale the point by the metro scale factor and then scale down |
| 388 // via the win32 scale factor which achieves the needful. | 388 // via the win32 scale factor which achieves the needful. |
| 389 gfx::Point dip_point_metro(point.X, point.Y); | 389 gfx::Point dip_point_metro(point.X, point.Y); |
| 390 gfx::Point scaled_point_metro = | 390 gfx::Point scaled_point_metro = |
| 391 gfx::ToCeiledPoint(gfx::ScalePoint(dip_point_metro, metro_dpi_scale_)); | 391 gfx::ScaleToCeiledPoint(dip_point_metro, metro_dpi_scale_); |
| 392 gfx::Point dip_point_win32 = | 392 gfx::Point dip_point_win32 = |
| 393 gfx::ToCeiledPoint(gfx::ScalePoint(scaled_point_metro, | 393 gfx::ScaleToCeiledPoint(scaled_point_metro, 1.0 / win32_dpi_scale_); |
| 394 1.0 / win32_dpi_scale_)); | |
| 395 x_ = dip_point_win32.x(); | 394 x_ = dip_point_win32.x(); |
| 396 y_ = dip_point_win32.y(); | 395 y_ = dip_point_win32.y(); |
| 397 | 396 |
| 398 pointer_point_->get_Timestamp(×tamp_); | 397 pointer_point_->get_Timestamp(×tamp_); |
| 399 pointer_point_->get_PointerId(&pointer_id_); | 398 pointer_point_->get_PointerId(&pointer_id_); |
| 400 // Map the OS touch event id to a range allowed by the gesture recognizer. | 399 // Map the OS touch event id to a range allowed by the gesture recognizer. |
| 401 if (IsTouch()) | 400 if (IsTouch()) |
| 402 pointer_id_ %= ui::MotionEvent::MAX_TOUCH_POINT_COUNT; | 401 pointer_id_ %= ui::MotionEvent::MAX_TOUCH_POINT_COUNT; |
| 403 | 402 |
| 404 boolean left_button_state; | 403 boolean left_button_state; |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1459 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
| 1461 CheckHR(core_app.As(&app_exit)); | 1460 CheckHR(core_app.As(&app_exit)); |
| 1462 globals.app_exit = app_exit.Detach(); | 1461 globals.app_exit = app_exit.Detach(); |
| 1463 } | 1462 } |
| 1464 | 1463 |
| 1465 IFACEMETHODIMP | 1464 IFACEMETHODIMP |
| 1466 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1465 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
| 1467 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1466 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
| 1468 return (*view) ? S_OK : E_OUTOFMEMORY; | 1467 return (*view) ? S_OK : E_OUTOFMEMORY; |
| 1469 } | 1468 } |
| OLD | NEW |