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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // Enter main core message loop. There are several ways to exit it | 271 // Enter main core message loop. There are several ways to exit it |
272 // Nicely: | 272 // Nicely: |
273 // 1 - User action like ALT-F4. | 273 // 1 - User action like ALT-F4. |
274 // 2 - Calling ICoreApplicationExit::Exit(). | 274 // 2 - Calling ICoreApplicationExit::Exit(). |
275 // 3- Posting WM_CLOSE to the core window. | 275 // 3- Posting WM_CLOSE to the core window. |
276 dispatcher->ProcessEvents( | 276 dispatcher->ProcessEvents( |
277 winui::Core::CoreProcessEventsOption | 277 winui::Core::CoreProcessEventsOption |
278 ::CoreProcessEventsOption_ProcessUntilQuit); | 278 ::CoreProcessEventsOption_ProcessUntilQuit); |
279 | 279 |
280 // Wind down the thread's chrome message loop. | 280 // Wind down the thread's chrome message loop. |
281 base::MessageLoop::current()->Quit(); | 281 base::MessageLoop::current()->QuitWhenIdle(); |
282 } | 282 } |
283 | 283 |
284 // Helper to return the state of the shift/control/alt keys. | 284 // Helper to return the state of the shift/control/alt keys. |
285 uint32 GetKeyboardEventFlags() { | 285 uint32 GetKeyboardEventFlags() { |
286 uint32 flags = 0; | 286 uint32 flags = 0; |
287 if (base::win::IsShiftPressed()) | 287 if (base::win::IsShiftPressed()) |
288 flags |= ui::EF_SHIFT_DOWN; | 288 flags |= ui::EF_SHIFT_DOWN; |
289 if (base::win::IsCtrlPressed()) | 289 if (base::win::IsCtrlPressed()) |
290 flags |= ui::EF_CONTROL_DOWN; | 290 flags |= ui::EF_CONTROL_DOWN; |
291 if (base::win::IsAltPressed()) | 291 if (base::win::IsAltPressed()) |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1460 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
1461 CheckHR(core_app.As(&app_exit)); | 1461 CheckHR(core_app.As(&app_exit)); |
1462 globals.app_exit = app_exit.Detach(); | 1462 globals.app_exit = app_exit.Detach(); |
1463 } | 1463 } |
1464 | 1464 |
1465 IFACEMETHODIMP | 1465 IFACEMETHODIMP |
1466 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1466 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
1467 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1467 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
1468 return (*view) ? S_OK : E_OUTOFMEMORY; | 1468 return (*view) ? S_OK : E_OUTOFMEMORY; |
1469 } | 1469 } |
OLD | NEW |