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

Side by Side Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 27058004: Use WindowActivated message instead of VisibilityChanged message to determine that Ash is the activ… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/metro_viewer/metro_viewer_messages.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 if (FAILED(hr)) 870 if (FAILED(hr))
871 return hr; 871 return hr;
872 872
873 ui_channel_->Send(new MetroViewerHostMsg_Character(char_code, 873 ui_channel_->Send(new MetroViewerHostMsg_Character(char_code,
874 status.RepeatCount, 874 status.RepeatCount,
875 status.ScanCode, 875 status.ScanCode,
876 GetKeyboardEventFlags())); 876 GetKeyboardEventFlags()));
877 return S_OK; 877 return S_OK;
878 } 878 }
879 879
880 HRESULT ChromeAppViewAsh::OnVisibilityChanged( 880 HRESULT ChromeAppViewAsh::OnVisibilityChanged(
gab 2013/10/11 21:21:13 I decided to keep this implementation around just
881 winui::Core::ICoreWindow* sender, 881 winui::Core::ICoreWindow* sender,
882 winui::Core::IVisibilityChangedEventArgs* args) { 882 winui::Core::IVisibilityChangedEventArgs* args) {
883 boolean visible = false; 883 boolean visible = false;
884 HRESULT hr = args->get_Visible(&visible); 884 HRESULT hr = args->get_Visible(&visible);
885 if (FAILED(hr)) 885 if (FAILED(hr))
886 return hr; 886 return hr;
887
888 ui_channel_->Send(new MetroViewerHostMsg_VisibilityChanged(!!visible));
889 return S_OK; 887 return S_OK;
890 } 888 }
891 889
892 HRESULT ChromeAppViewAsh::OnWindowActivated( 890 HRESULT ChromeAppViewAsh::OnWindowActivated(
893 winui::Core::ICoreWindow* sender, 891 winui::Core::ICoreWindow* sender,
894 winui::Core::IWindowActivatedEventArgs* args) { 892 winui::Core::IWindowActivatedEventArgs* args) {
895 winui::Core::CoreWindowActivationState state; 893 winui::Core::CoreWindowActivationState state;
896 HRESULT hr = args->get_WindowActivationState(&state); 894 HRESULT hr = args->get_WindowActivationState(&state);
897 if (FAILED(hr)) 895 if (FAILED(hr))
898 return hr; 896 return hr;
897
898 // Treat both full activation (Ash was reopened from the Start Screen or from
899 // any other Metro entry point in Windows) and pointer activation (user
900 // clicked back in Ash after using another app on another screen) the same.
901 if (state == winui::Core::CoreWindowActivationState_CodeActivated ||
902 state == winui::Core::CoreWindowActivationState_PointerActivated) {
903 ui_channel_->Send(new MetroViewerHostMsg_WindowActivated());
904 }
899 return S_OK; 905 return S_OK;
900 } 906 }
901 907
902 HRESULT ChromeAppViewAsh::HandleSearchRequest( 908 HRESULT ChromeAppViewAsh::HandleSearchRequest(
903 winapp::Activation::IActivatedEventArgs* args) { 909 winapp::Activation::IActivatedEventArgs* args) {
904 mswr::ComPtr<winapp::Activation::ISearchActivatedEventArgs> search_args; 910 mswr::ComPtr<winapp::Activation::ISearchActivatedEventArgs> search_args;
905 CheckHR(args->QueryInterface( 911 CheckHR(args->QueryInterface(
906 winapp::Activation::IID_ISearchActivatedEventArgs, &search_args)); 912 winapp::Activation::IID_ISearchActivatedEventArgs, &search_args));
907 913
908 if (!ui_channel_) { 914 if (!ui_channel_) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; 992 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit;
987 CheckHR(core_app.As(&app_exit)); 993 CheckHR(core_app.As(&app_exit));
988 globals.app_exit = app_exit.Detach(); 994 globals.app_exit = app_exit.Detach();
989 } 995 }
990 996
991 IFACEMETHODIMP 997 IFACEMETHODIMP
992 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { 998 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) {
993 *view = mswr::Make<ChromeAppViewAsh>().Detach(); 999 *view = mswr::Make<ChromeAppViewAsh>().Detach();
994 return (*view) ? S_OK : E_OUTOFMEMORY; 1000 return (*view) ? S_OK : E_OUTOFMEMORY;
995 } 1001 }
OLDNEW
« no previous file with comments | « ui/metro_viewer/metro_viewer_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698