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 "stdafx.h" | 5 #include "stdafx.h" |
6 #include <corewindow.h> | 6 #include <corewindow.h> |
7 #include <shobjidl.h> | 7 #include <shobjidl.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 AcceleratorKeyEventHandler* accelerator_key_event_handler_; | 531 AcceleratorKeyEventHandler* accelerator_key_event_handler_; |
532 }; | 532 }; |
533 | 533 |
534 class CoreWindowEmulation | 534 class CoreWindowEmulation |
535 : public mswr::RuntimeClass< | 535 : public mswr::RuntimeClass< |
536 mswr::RuntimeClassFlags<mswr::WinRtClassicComMix>, | 536 mswr::RuntimeClassFlags<mswr::WinRtClassicComMix>, |
537 winui::Core::ICoreWindow, ICoreWindowInterop>, | 537 winui::Core::ICoreWindow, ICoreWindowInterop>, |
538 public InputHandler { | 538 public InputHandler { |
539 public: | 539 public: |
540 CoreWindowEmulation(winapp::Core::IFrameworkView* app_view) | 540 CoreWindowEmulation(winapp::Core::IFrameworkView* app_view) |
541 : core_hwnd_(NULL), | 541 : mouse_moved_handler_(NULL), |
542 mouse_moved_handler_(NULL), | |
543 mouse_capture_lost_handler_(NULL), | 542 mouse_capture_lost_handler_(NULL), |
544 mouse_pressed_handler_(NULL), | 543 mouse_pressed_handler_(NULL), |
545 mouse_released_handler_(NULL), | 544 mouse_released_handler_(NULL), |
546 mouse_entered_handler_(NULL), | 545 mouse_entered_handler_(NULL), |
547 mouse_exited_handler_(NULL), | 546 mouse_exited_handler_(NULL), |
548 mouse_wheel_changed_handler_(NULL), | 547 mouse_wheel_changed_handler_(NULL), |
549 key_down_handler_(NULL), | 548 key_down_handler_(NULL), |
550 key_up_handler_(NULL), | 549 key_up_handler_(NULL), |
551 character_received_handler_(NULL), | 550 character_received_handler_(NULL), |
| 551 core_hwnd_(NULL), |
552 app_view_(app_view), | 552 app_view_(app_view), |
553 window_activated_handler_(NULL) { | 553 window_activated_handler_(NULL) { |
554 dispatcher_ = mswr::Make<CoreDispatcherEmulation>(this); | 554 dispatcher_ = mswr::Make<CoreDispatcherEmulation>(this); |
555 | 555 |
556 // Unless we select our own AppUserModelID the shell might confuse us | 556 // Unless we select our own AppUserModelID the shell might confuse us |
557 // with the app launcher one and we get the wrong taskbar button and icon. | 557 // with the app launcher one and we get the wrong taskbar button and icon. |
558 ::SetCurrentProcessExplicitAppUserModelID(kAshWin7AppId); | 558 ::SetCurrentProcessExplicitAppUserModelID(kAshWin7AppId); |
559 | 559 |
560 RECT work_area = {0}; | 560 RECT work_area = {0}; |
561 ::SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0); | 561 ::SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0); |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 }; | 1218 }; |
1219 | 1219 |
1220 | 1220 |
1221 mswr::ComPtr<winapp::Core::ICoreApplication> InitWindows7() { | 1221 mswr::ComPtr<winapp::Core::ICoreApplication> InitWindows7() { |
1222 HRESULT hr = ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); | 1222 HRESULT hr = ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); |
1223 if (FAILED(hr)) | 1223 if (FAILED(hr)) |
1224 CHECK(false); | 1224 CHECK(false); |
1225 return mswr::Make<CoreApplicationWin7Emulation>(); | 1225 return mswr::Make<CoreApplicationWin7Emulation>(); |
1226 } | 1226 } |
1227 | 1227 |
OLD | NEW |