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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 } | 963 } |
964 } else { | 964 } else { |
965 if (ui_channel_) | 965 if (ui_channel_) |
966 ui_channel_->Close(); | 966 ui_channel_->Close(); |
967 | 967 |
968 HWND core_window = core_window_hwnd(); | 968 HWND core_window = core_window_hwnd(); |
969 ::PostMessage(core_window, WM_CLOSE, 0, 0); | 969 ::PostMessage(core_window, WM_CLOSE, 0, 0); |
970 | 970 |
971 globals.app_exit->Exit(); | 971 globals.app_exit->Exit(); |
972 } | 972 } |
973 | |
974 // Try really hard, see http://crbug.com/411147 for details. | |
975 ::TerminateProcess(::GetCurrentProcess(), 0); | |
976 } | 973 } |
977 | 974 |
978 void ChromeAppViewAsh::OnInputSourceChanged() { | 975 void ChromeAppViewAsh::OnInputSourceChanged() { |
979 if (!input_source_) | 976 if (!input_source_) |
980 return; | 977 return; |
981 | 978 |
982 LANGID langid = 0; | 979 LANGID langid = 0; |
983 bool is_ime = false; | 980 bool is_ime = false; |
984 if (!input_source_->GetActiveSource(&langid, &is_ime)) { | 981 if (!input_source_->GetActiveSource(&langid, &is_ime)) { |
985 LOG(ERROR) << "GetActiveSource failed"; | 982 LOG(ERROR) << "GetActiveSource failed"; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1400 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
1404 CheckHR(core_app.As(&app_exit)); | 1401 CheckHR(core_app.As(&app_exit)); |
1405 globals.app_exit = app_exit.Detach(); | 1402 globals.app_exit = app_exit.Detach(); |
1406 } | 1403 } |
1407 | 1404 |
1408 IFACEMETHODIMP | 1405 IFACEMETHODIMP |
1409 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1406 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
1410 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1407 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
1411 return (*view) ? S_OK : E_OUTOFMEMORY; | 1408 return (*view) ? S_OK : E_OUTOFMEMORY; |
1412 } | 1409 } |
OLD | NEW |