summaryrefslogtreecommitdiff
path: root/win8
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-10-22 16:41:35 +0100
committerTorne (Richard Coles) <torne@google.com>2013-10-22 16:41:35 +0100
commit8bcbed890bc3ce4d7a057a8f32cab53fa534672e (patch)
tree1390b6675d21328859f01f50203d9bde09105298 /win8
parent116fa16b45c9efe30e785b9fc32f09780ca23bec (diff)
downloadchromium_org-8bcbed890bc3ce4d7a057a8f32cab53fa534672e.tar.gz
Merge from Chromium at DEPS revision 230120
This commit was generated by merge_to_master.py. Change-Id: I54bc06b7ee8a07092e74ce3b68c6893508349042
Diffstat (limited to 'win8')
-rw-r--r--win8/metro_driver/chrome_app_view_ash.cc48
-rw-r--r--win8/metro_driver/chrome_app_view_ash.h4
2 files changed, 19 insertions, 33 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index e39118b850..b795b928bc 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -50,10 +50,6 @@ typedef winfoundtn::ITypedEventHandler<
typedef winfoundtn::ITypedEventHandler<
winui::Core::CoreWindow*,
- winui::Core::VisibilityChangedEventArgs*> VisibilityChangedHandler;
-
-typedef winfoundtn::ITypedEventHandler<
- winui::Core::CoreWindow*,
winui::Core::WindowActivatedEventArgs*> WindowActivatedHandler;
typedef winfoundtn::ITypedEventHandler<
@@ -80,7 +76,8 @@ void MetroExit() {
class ChromeChannelListener : public IPC::Listener {
public:
ChromeChannelListener(base::MessageLoop* ui_loop, ChromeAppViewAsh* app_view)
- : ui_proxy_(ui_loop->message_loop_proxy()), app_view_(app_view) {}
+ : ui_proxy_(ui_loop->message_loop_proxy()),
+ app_view_(app_view) {}
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
IPC_BEGIN_MESSAGE_MAP(ChromeChannelListener, message)
@@ -177,13 +174,13 @@ bool WaitForChromeIPCConnection(const std::string& channel_name) {
// This class helps decoding the pointer properties of an event.
class PointerInfoHandler {
public:
- PointerInfoHandler() :
- x_(0),
- y_(0),
- wheel_delta_(0),
- update_kind_(winui::Input::PointerUpdateKind_Other),
- timestamp_(0),
- pointer_id_(0) {}
+ PointerInfoHandler()
+ : x_(0),
+ y_(0),
+ wheel_delta_(0),
+ update_kind_(winui::Input::PointerUpdateKind_Other),
+ timestamp_(0),
+ pointer_id_(0) {}
HRESULT Init(winui::Core::IPointerEventArgs* args) {
HRESULT hr = args->get_CurrentPoint(&pointer_point_);
@@ -421,11 +418,6 @@ ChromeAppViewAsh::SetWindow(winui::Core::ICoreWindow* window) {
&character_received_token_);
CheckHR(hr);
- hr = window_->add_VisibilityChanged(mswr::Callback<VisibilityChangedHandler>(
- this, &ChromeAppViewAsh::OnVisibilityChanged).Get(),
- &visibility_changed_token_);
- CheckHR(hr);
-
hr = window_->add_Activated(mswr::Callback<WindowActivatedHandler>(
this, &ChromeAppViewAsh::OnWindowActivated).Get(),
&window_activated_token_);
@@ -712,6 +704,7 @@ HRESULT ChromeAppViewAsh::OnPointerPressed(
return hr;
if (pointer.IsMouse()) {
+ // TODO: this is wrong, more than one pointer may be down at a time.
mouse_down_flags_ = pointer.flags();
ui_channel_->Send(new MetroViewerHostMsg_MouseButton(
pointer.x(),
@@ -739,6 +732,7 @@ HRESULT ChromeAppViewAsh::OnPointerReleased(
return hr;
if (pointer.IsMouse()) {
+ // TODO: this is wrong, more than one pointer may be down at a time.
mouse_down_flags_ = ui::EF_NONE;
ui_channel_->Send(new MetroViewerHostMsg_MouseButton(
pointer.x(),
@@ -877,18 +871,6 @@ HRESULT ChromeAppViewAsh::OnCharacterReceived(
return S_OK;
}
-HRESULT ChromeAppViewAsh::OnVisibilityChanged(
- winui::Core::ICoreWindow* sender,
- winui::Core::IVisibilityChangedEventArgs* args) {
- boolean visible = false;
- HRESULT hr = args->get_Visible(&visible);
- if (FAILED(hr))
- return hr;
-
- ui_channel_->Send(new MetroViewerHostMsg_VisibilityChanged(!!visible));
- return S_OK;
-}
-
HRESULT ChromeAppViewAsh::OnWindowActivated(
winui::Core::ICoreWindow* sender,
winui::Core::IWindowActivatedEventArgs* args) {
@@ -896,6 +878,14 @@ HRESULT ChromeAppViewAsh::OnWindowActivated(
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) {
+ ui_channel_->Send(new MetroViewerHostMsg_WindowActivated());
+ }
return S_OK;
}
diff --git a/win8/metro_driver/chrome_app_view_ash.h b/win8/metro_driver/chrome_app_view_ash.h
index c1b95331a0..0f9a14a4c9 100644
--- a/win8/metro_driver/chrome_app_view_ash.h
+++ b/win8/metro_driver/chrome_app_view_ash.h
@@ -110,9 +110,6 @@ class ChromeAppViewAsh
HRESULT OnCharacterReceived(winui::Core::ICoreWindow* sender,
winui::Core::ICharacterReceivedEventArgs* args);
- HRESULT OnVisibilityChanged(winui::Core::ICoreWindow* sender,
- winui::Core::IVisibilityChangedEventArgs* args);
-
HRESULT OnWindowActivated(winui::Core::ICoreWindow* sender,
winui::Core::IWindowActivatedEventArgs* args);
@@ -139,7 +136,6 @@ class ChromeAppViewAsh
EventRegistrationToken keydown_token_;
EventRegistrationToken keyup_token_;
EventRegistrationToken character_received_token_;
- EventRegistrationToken visibility_changed_token_;
EventRegistrationToken accel_keydown_token_;
EventRegistrationToken accel_keyup_token_;
EventRegistrationToken window_activated_token_;