| 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.h" | 6 #include "win8/metro_driver/chrome_app_view.h" |
| 7 | 7 |
| 8 #include <corewindow.h> | 8 #include <corewindow.h> |
| 9 #include <windows.applicationModel.datatransfer.h> | 9 #include <windows.applicationModel.datatransfer.h> |
| 10 #include <windows.foundation.h> | 10 #include <windows.foundation.h> |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // Enter main core message loop. There are several ways to exit it | 758 // Enter main core message loop. There are several ways to exit it |
| 759 // Nicely: | 759 // Nicely: |
| 760 // 1 - User action like ALT-F4. | 760 // 1 - User action like ALT-F4. |
| 761 // 2 - Calling ICoreApplicationExit::Exit(). | 761 // 2 - Calling ICoreApplicationExit::Exit(). |
| 762 // 3- Posting WM_CLOSE to the core window. | 762 // 3- Posting WM_CLOSE to the core window. |
| 763 HRESULT hr = dispatcher->ProcessEvents( | 763 HRESULT hr = dispatcher->ProcessEvents( |
| 764 winui::Core::CoreProcessEventsOption | 764 winui::Core::CoreProcessEventsOption |
| 765 ::CoreProcessEventsOption_ProcessUntilQuit); | 765 ::CoreProcessEventsOption_ProcessUntilQuit); |
| 766 | 766 |
| 767 // Wind down the thread's chrome message loop. | 767 // Wind down the thread's chrome message loop. |
| 768 base::MessageLoop::current()->Quit(); | 768 base::MessageLoop::current()->QuitWhenIdle(); |
| 769 } | 769 } |
| 770 | 770 |
| 771 void ChromeAppView::CheckForOSKActivation() { | 771 void ChromeAppView::CheckForOSKActivation() { |
| 772 // Hack for checking if the OSK was displayed while we are in the foreground. | 772 // Hack for checking if the OSK was displayed while we are in the foreground. |
| 773 // The input pane notifications which are supposed to fire when the OSK is | 773 // The input pane notifications which are supposed to fire when the OSK is |
| 774 // shown and hidden don't seem to be firing in Windows 8 metro for us. | 774 // shown and hidden don't seem to be firing in Windows 8 metro for us. |
| 775 // The current hack is supposed to workaround that issue till we figure it | 775 // The current hack is supposed to workaround that issue till we figure it |
| 776 // out. Logic is to find the OSK window and see if we are the foreground | 776 // out. Logic is to find the OSK window and see if we are the foreground |
| 777 // process. If yes then fire the notification once for when the OSK is shown | 777 // process. If yes then fire the notification once for when the OSK is shown |
| 778 // and once for when it is hidden. | 778 // and once for when it is hidden. |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 CheckHR(core_app.As(&app_exit)); | 1207 CheckHR(core_app.As(&app_exit)); |
| 1208 globals.app_exit = app_exit.Detach(); | 1208 globals.app_exit = app_exit.Detach(); |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 IFACEMETHODIMP | 1211 IFACEMETHODIMP |
| 1212 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1212 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
| 1213 globals.view = mswr::Make<ChromeAppView>().Detach(); | 1213 globals.view = mswr::Make<ChromeAppView>().Detach(); |
| 1214 *view = globals.view; | 1214 *view = globals.view; |
| 1215 return (*view) ? S_OK : E_OUTOFMEMORY; | 1215 return (*view) ? S_OK : E_OUTOFMEMORY; |
| 1216 } | 1216 } |
| OLD | NEW |