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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1273 ui_channel_->Send(new MetroViewerHostMsg_Character(char_code, | 1273 ui_channel_->Send(new MetroViewerHostMsg_Character(char_code, |
1274 status.RepeatCount, | 1274 status.RepeatCount, |
1275 status.ScanCode, | 1275 status.ScanCode, |
1276 GetKeyboardEventFlags())); | 1276 GetKeyboardEventFlags())); |
1277 return S_OK; | 1277 return S_OK; |
1278 } | 1278 } |
1279 | 1279 |
1280 HRESULT ChromeAppViewAsh::OnWindowActivated( | 1280 HRESULT ChromeAppViewAsh::OnWindowActivated( |
1281 winui::Core::ICoreWindow* sender, | 1281 winui::Core::ICoreWindow* sender, |
1282 winui::Core::IWindowActivatedEventArgs* args) { | 1282 winui::Core::IWindowActivatedEventArgs* args) { |
1283 winui::Core::CoreWindowActivationState state; | 1283 if (args) { |
1284 HRESULT hr = args->get_WindowActivationState(&state); | 1284 winui::Core::CoreWindowActivationState state; |
1285 if (FAILED(hr)) | 1285 HRESULT hr = args->get_WindowActivationState(&state); |
1286 return hr; | 1286 if (FAILED(hr)) |
1287 return hr; | |
1287 | 1288 |
1288 // Treat both full activation (Ash was reopened from the Start Screen or from | 1289 // Treat both full activation (Ash was reopened from the Start Screen or |
1289 // any other Metro entry point in Windows) and pointer activation (user | 1290 // from any other Metro entry point in Windows) and pointer activation |
1290 // clicked back in Ash after using another app on another monitor) the same. | 1291 // (user clicked back in Ash after using another app on another monitor) |
1291 if (state == winui::Core::CoreWindowActivationState_CodeActivated || | 1292 // the same. |
1292 state == winui::Core::CoreWindowActivationState_PointerActivated) { | 1293 if (state == winui::Core::CoreWindowActivationState_CodeActivated || |
1293 if (text_service_) | 1294 state == winui::Core::CoreWindowActivationState_PointerActivated) { |
1294 text_service_->OnWindowActivated(); | 1295 if (text_service_) |
1296 text_service_->OnWindowActivated(); | |
1297 ui_channel_->Send(new MetroViewerHostMsg_WindowActivated()); | |
1298 } | |
1299 } else { | |
cpu_(ooo_6.6-7.5)
2014/09/04 19:13:21
// On windows 7 we need to force a redraw after th
ananta
2014/09/04 19:27:07
Added a comment. We also pass in a bool in the IPC
| |
1295 ui_channel_->Send(new MetroViewerHostMsg_WindowActivated()); | 1300 ui_channel_->Send(new MetroViewerHostMsg_WindowActivated()); |
1296 } | 1301 } |
1297 return S_OK; | 1302 return S_OK; |
1298 } | 1303 } |
1299 | 1304 |
1300 HRESULT ChromeAppViewAsh::HandleSearchRequest( | 1305 HRESULT ChromeAppViewAsh::HandleSearchRequest( |
1301 winapp::Activation::IActivatedEventArgs* args) { | 1306 winapp::Activation::IActivatedEventArgs* args) { |
1302 mswr::ComPtr<winapp::Activation::ISearchActivatedEventArgs> search_args; | 1307 mswr::ComPtr<winapp::Activation::ISearchActivatedEventArgs> search_args; |
1303 CheckHR(args->QueryInterface( | 1308 CheckHR(args->QueryInterface( |
1304 winapp::Activation::IID_ISearchActivatedEventArgs, &search_args)); | 1309 winapp::Activation::IID_ISearchActivatedEventArgs, &search_args)); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1390 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1395 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
1391 CheckHR(core_app.As(&app_exit)); | 1396 CheckHR(core_app.As(&app_exit)); |
1392 globals.app_exit = app_exit.Detach(); | 1397 globals.app_exit = app_exit.Detach(); |
1393 } | 1398 } |
1394 | 1399 |
1395 IFACEMETHODIMP | 1400 IFACEMETHODIMP |
1396 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1401 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
1397 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1402 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
1398 return (*view) ? S_OK : E_OUTOFMEMORY; | 1403 return (*view) ? S_OK : E_OUTOFMEMORY; |
1399 } | 1404 } |
OLD | NEW |