Chromium Code Reviews| 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 870 if (FAILED(hr)) | 870 if (FAILED(hr)) |
| 871 return hr; | 871 return hr; |
| 872 | 872 |
| 873 ui_channel_->Send(new MetroViewerHostMsg_Character(char_code, | 873 ui_channel_->Send(new MetroViewerHostMsg_Character(char_code, |
| 874 status.RepeatCount, | 874 status.RepeatCount, |
| 875 status.ScanCode, | 875 status.ScanCode, |
| 876 GetKeyboardEventFlags())); | 876 GetKeyboardEventFlags())); |
| 877 return S_OK; | 877 return S_OK; |
| 878 } | 878 } |
| 879 | 879 |
| 880 HRESULT ChromeAppViewAsh::OnVisibilityChanged( | 880 HRESULT ChromeAppViewAsh::OnVisibilityChanged( |
|
gab
2013/10/11 21:21:13
I decided to keep this implementation around just
| |
| 881 winui::Core::ICoreWindow* sender, | 881 winui::Core::ICoreWindow* sender, |
| 882 winui::Core::IVisibilityChangedEventArgs* args) { | 882 winui::Core::IVisibilityChangedEventArgs* args) { |
| 883 boolean visible = false; | 883 boolean visible = false; |
| 884 HRESULT hr = args->get_Visible(&visible); | 884 HRESULT hr = args->get_Visible(&visible); |
| 885 if (FAILED(hr)) | 885 if (FAILED(hr)) |
| 886 return hr; | 886 return hr; |
| 887 | |
| 888 ui_channel_->Send(new MetroViewerHostMsg_VisibilityChanged(!!visible)); | |
| 889 return S_OK; | 887 return S_OK; |
| 890 } | 888 } |
| 891 | 889 |
| 892 HRESULT ChromeAppViewAsh::OnWindowActivated( | 890 HRESULT ChromeAppViewAsh::OnWindowActivated( |
| 893 winui::Core::ICoreWindow* sender, | 891 winui::Core::ICoreWindow* sender, |
| 894 winui::Core::IWindowActivatedEventArgs* args) { | 892 winui::Core::IWindowActivatedEventArgs* args) { |
| 895 winui::Core::CoreWindowActivationState state; | 893 winui::Core::CoreWindowActivationState state; |
| 896 HRESULT hr = args->get_WindowActivationState(&state); | 894 HRESULT hr = args->get_WindowActivationState(&state); |
| 897 if (FAILED(hr)) | 895 if (FAILED(hr)) |
| 898 return hr; | 896 return hr; |
| 897 | |
| 898 // Treat both full activation (Ash was reopened from the Start Screen or from | |
| 899 // any other Metro entry point in Windows) and pointer activation (user | |
| 900 // clicked back in Ash after using another app on another screen) the same. | |
| 901 if (state == winui::Core::CoreWindowActivationState_CodeActivated || | |
| 902 state == winui::Core::CoreWindowActivationState_PointerActivated) { | |
| 903 ui_channel_->Send(new MetroViewerHostMsg_WindowActivated()); | |
| 904 } | |
| 899 return S_OK; | 905 return S_OK; |
| 900 } | 906 } |
| 901 | 907 |
| 902 HRESULT ChromeAppViewAsh::HandleSearchRequest( | 908 HRESULT ChromeAppViewAsh::HandleSearchRequest( |
| 903 winapp::Activation::IActivatedEventArgs* args) { | 909 winapp::Activation::IActivatedEventArgs* args) { |
| 904 mswr::ComPtr<winapp::Activation::ISearchActivatedEventArgs> search_args; | 910 mswr::ComPtr<winapp::Activation::ISearchActivatedEventArgs> search_args; |
| 905 CheckHR(args->QueryInterface( | 911 CheckHR(args->QueryInterface( |
| 906 winapp::Activation::IID_ISearchActivatedEventArgs, &search_args)); | 912 winapp::Activation::IID_ISearchActivatedEventArgs, &search_args)); |
| 907 | 913 |
| 908 if (!ui_channel_) { | 914 if (!ui_channel_) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 986 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 992 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
| 987 CheckHR(core_app.As(&app_exit)); | 993 CheckHR(core_app.As(&app_exit)); |
| 988 globals.app_exit = app_exit.Detach(); | 994 globals.app_exit = app_exit.Detach(); |
| 989 } | 995 } |
| 990 | 996 |
| 991 IFACEMETHODIMP | 997 IFACEMETHODIMP |
| 992 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 998 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
| 993 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 999 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
| 994 return (*view) ? S_OK : E_OUTOFMEMORY; | 1000 return (*view) ? S_OK : E_OUTOFMEMORY; |
| 995 } | 1001 } |
| OLD | NEW |