Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 546503002: Notify the Chrome browser process about the window being activated from the viewer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/metro_viewer/metro_viewer_messages.h ('k') | win8/metro_driver/metro_driver_win7.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/chrome_app_view_ash.cc
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index 98e52b375f62aa33182906a991d8c84783cd0980..d2ba8dc33e48751715fd582d2beedb05479c6025 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -1280,19 +1280,25 @@ HRESULT ChromeAppViewAsh::OnCharacterReceived(
HRESULT ChromeAppViewAsh::OnWindowActivated(
winui::Core::ICoreWindow* sender,
winui::Core::IWindowActivatedEventArgs* args) {
- winui::Core::CoreWindowActivationState state;
- HRESULT hr = args->get_WindowActivationState(&state);
- if (FAILED(hr))
- return hr;
+ if (args) {
+ winui::Core::CoreWindowActivationState state;
+ HRESULT hr = args->get_WindowActivationState(&state);
+ if (FAILED(hr))
+ return hr;
- // Treat both full activation (Ash was reopened from the Start Screen or from
- // any other Metro entry point in Windows) and pointer activation (user
- // clicked back in Ash after using another app on another monitor) the same.
- if (state == winui::Core::CoreWindowActivationState_CodeActivated ||
- state == winui::Core::CoreWindowActivationState_PointerActivated) {
- if (text_service_)
- text_service_->OnWindowActivated();
- ui_channel_->Send(new MetroViewerHostMsg_WindowActivated());
+ // Treat both full activation (Ash was reopened from the Start Screen or
+ // from any other Metro entry point in Windows) and pointer activation
+ // (user clicked back in Ash after using another app on another monitor)
+ // the same.
+ if (state == winui::Core::CoreWindowActivationState_CodeActivated ||
+ state == winui::Core::CoreWindowActivationState_PointerActivated) {
+ if (text_service_)
+ text_service_->OnWindowActivated();
+ ui_channel_->Send(new MetroViewerHostMsg_WindowActivated(false));
+ }
+ } else {
+ // On Windows 7, we force a repaint when the window is activated.
+ ui_channel_->Send(new MetroViewerHostMsg_WindowActivated(true));
}
return S_OK;
}
« no previous file with comments | « ui/metro_viewer/metro_viewer_messages.h ('k') | win8/metro_driver/metro_driver_win7.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698