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 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 | 1153 |
1154 HRESULT ChromeAppViewAsh::OnWheel( | 1154 HRESULT ChromeAppViewAsh::OnWheel( |
1155 winui::Core::ICoreWindow* sender, | 1155 winui::Core::ICoreWindow* sender, |
1156 winui::Core::IPointerEventArgs* args) { | 1156 winui::Core::IPointerEventArgs* args) { |
1157 PointerInfoHandler pointer(metro_dpi_scale_, win32_dpi_scale_); | 1157 PointerInfoHandler pointer(metro_dpi_scale_, win32_dpi_scale_); |
1158 HRESULT hr = pointer.Init(args); | 1158 HRESULT hr = pointer.Init(args); |
1159 if (FAILED(hr)) | 1159 if (FAILED(hr)) |
1160 return hr; | 1160 return hr; |
1161 DCHECK(pointer.IsMouse()); | 1161 DCHECK(pointer.IsMouse()); |
1162 SendMouseButton(pointer.x(), pointer.y(), pointer.wheel_delta(), | 1162 SendMouseButton(pointer.x(), pointer.y(), pointer.wheel_delta(), |
1163 ui::ET_MOUSEWHEEL, ui::EF_NONE, ui::EF_NONE, | 1163 ui::ET_MOUSEWHEEL, GetKeyboardEventFlags(), ui::EF_NONE, |
1164 pointer.is_horizontal_wheel()); | 1164 pointer.is_horizontal_wheel()); |
1165 return S_OK; | 1165 return S_OK; |
1166 } | 1166 } |
1167 | 1167 |
1168 HRESULT ChromeAppViewAsh::OnKeyDown( | 1168 HRESULT ChromeAppViewAsh::OnKeyDown( |
1169 winui::Core::ICoreWindow* sender, | 1169 winui::Core::ICoreWindow* sender, |
1170 winui::Core::IKeyEventArgs* args) { | 1170 winui::Core::IKeyEventArgs* args) { |
1171 winsys::VirtualKey virtual_key; | 1171 winsys::VirtualKey virtual_key; |
1172 HRESULT hr = args->get_VirtualKey(&virtual_key); | 1172 HRESULT hr = args->get_VirtualKey(&virtual_key); |
1173 if (FAILED(hr)) | 1173 if (FAILED(hr)) |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1396 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
1397 CheckHR(core_app.As(&app_exit)); | 1397 CheckHR(core_app.As(&app_exit)); |
1398 globals.app_exit = app_exit.Detach(); | 1398 globals.app_exit = app_exit.Detach(); |
1399 } | 1399 } |
1400 | 1400 |
1401 IFACEMETHODIMP | 1401 IFACEMETHODIMP |
1402 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1402 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
1403 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1403 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
1404 return (*view) ? S_OK : E_OUTOFMEMORY; | 1404 return (*view) ? S_OK : E_OUTOFMEMORY; |
1405 } | 1405 } |
OLD | NEW |