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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
964 SendKeySequence(VK_F4, ALT); | 964 SendKeySequence(VK_F4, ALT); |
965 if (ui_channel_) | 965 if (ui_channel_) |
966 ui_channel_->Close(); | 966 ui_channel_->Close(); |
967 } else { | 967 } else { |
968 globals.app_exit->Exit(); | 968 globals.app_exit->Exit(); |
969 } | 969 } |
970 } else { | 970 } else { |
971 if (ui_channel_) | 971 if (ui_channel_) |
972 ui_channel_->Close(); | 972 ui_channel_->Close(); |
973 | 973 |
974 HWND core_window = core_window_hwnd(); | |
975 ::PostMessage(core_window, WM_CLOSE, 0, 0); | |
976 | |
Shrikant Kelkar
2014/09/12 21:53:29
Instead of using multiple close methods may be mer
ananta
2014/09/12 23:49:58
This function is fragile and the ordering of state
| |
974 globals.app_exit->Exit(); | 977 globals.app_exit->Exit(); |
975 } | 978 } |
976 } | 979 } |
977 | 980 |
978 void ChromeAppViewAsh::OnInputSourceChanged() { | 981 void ChromeAppViewAsh::OnInputSourceChanged() { |
979 if (!input_source_) | 982 if (!input_source_) |
980 return; | 983 return; |
981 | 984 |
982 LANGID langid = 0; | 985 LANGID langid = 0; |
983 bool is_ime = false; | 986 bool is_ime = false; |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1403 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1406 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
1404 CheckHR(core_app.As(&app_exit)); | 1407 CheckHR(core_app.As(&app_exit)); |
1405 globals.app_exit = app_exit.Detach(); | 1408 globals.app_exit = app_exit.Detach(); |
1406 } | 1409 } |
1407 | 1410 |
1408 IFACEMETHODIMP | 1411 IFACEMETHODIMP |
1409 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1412 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
1410 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1413 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
1411 return (*view) ? S_OK : E_OUTOFMEMORY; | 1414 return (*view) ? S_OK : E_OUTOFMEMORY; |
1412 } | 1415 } |
OLD | NEW |