summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorananta <ananta@chromium.org>2015-08-14 16:35:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-14 23:36:11 +0000
commitee20880b00c6381d4393fd9f1927459034871c63 (patch)
tree91881f8cae48156c57a57f489f93835119f2fd7a /ui
parent9b22bc6fcab1760b4220076b1d39043c08ce4382 (diff)
downloadchromium_src-ee20880b00c6381d4393fd9f1927459034871c63.zip
chromium_src-ee20880b00c6381d4393fd9f1927459034871c63.tar.gz
chromium_src-ee20880b00c6381d4393fd9f1927459034871c63.tar.bz2
Remove the CHECK from the DirectManipulationHelper::Activate function as it is firing in Canary on Windows 10.
Crash dump analysis reveals the error code to be E_UNEXPECTED. Some disassembling into the Direct Manipulation Activate function did not reveal a code path where the above error is returned. Based on the crash dump analysis it looks like Activate is called on a window which is visible but has 0 dimensions which could possibly be triggering this. In any case it is also possible that calling Activate multiple times on a window may be triggering this. I was unable to repro the crash though. Proposed fixes include :- 1. Remove the CHECK from the DirectManipulationHelper::Activate function. 2. Add a new function DirectManipulationHelper::Deactivate which deactivates Direct manipulation processing on the window. This is called from views and content when the window is hidden. BUG=520492 Review URL: https://codereview.chromium.org/1295683003 Cr-Commit-Position: refs/heads/master@{#343526}
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/win/direct_manipulation.cc8
-rw-r--r--ui/gfx/win/direct_manipulation.h6
-rw-r--r--ui/views/win/hwnd_message_handler.cc9
3 files changed, 18 insertions, 5 deletions
diff --git a/ui/gfx/win/direct_manipulation.cc b/ui/gfx/win/direct_manipulation.cc
index f7f4aa5..2014c70 100644
--- a/ui/gfx/win/direct_manipulation.cc
+++ b/ui/gfx/win/direct_manipulation.cc
@@ -91,8 +91,12 @@ void DirectManipulationHelper::SetBounds(const gfx::Rect& bounds) {
void DirectManipulationHelper::Activate(HWND window) {
DCHECK(::IsWindow(window));
- HRESULT hr = manager_->Activate(window);
- CHECK(SUCCEEDED(hr));
+ manager_->Activate(window);
+}
+
+void DirectManipulationHelper::Deactivate(HWND window) {
+ DCHECK(::IsWindow(window));
+ manager_->Deactivate(window);
}
void DirectManipulationHelper:: HandleMouseWheel(HWND window, UINT message,
diff --git a/ui/gfx/win/direct_manipulation.h b/ui/gfx/win/direct_manipulation.h
index 23048c7..a6bcc45 100644
--- a/ui/gfx/win/direct_manipulation.h
+++ b/ui/gfx/win/direct_manipulation.h
@@ -52,9 +52,13 @@ class GFX_EXPORT DirectManipulationHelper {
// of the legacy window.
void SetBounds(const gfx::Rect& bounds);
- // Registers the passed in |window| as a Direct Manipulation consumer.
+ // Registers and activates the passed in |window| as a Direct Manipulation
+ // consumer.
void Activate(HWND window);
+ // Deactivates Direct Manipulation processing on the passed in |window|.
+ void Deactivate(HWND window);
+
// Passes the WM_MOUSEWHEEL messages to Direct Manipulation. This is for
// logistics purposes.
void HandleMouseWheel(HWND window, UINT message, WPARAM w_param,
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 41ec2d1..b394556 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -2520,10 +2520,15 @@ void HWNDMessageHandler::OnWindowPosChanged(WINDOWPOS* window_pos) {
MARGINS m = {10, 10, 10, 10};
DwmExtendFrameIntoClientArea(hwnd(), &m);
}
- if (window_pos->flags & SWP_SHOWWINDOW)
+ if (window_pos->flags & SWP_SHOWWINDOW) {
delegate_->HandleVisibilityChanged(true);
- else if (window_pos->flags & SWP_HIDEWINDOW)
+ if (direct_manipulation_helper_)
+ direct_manipulation_helper_->Activate(hwnd());
+ } else if (window_pos->flags & SWP_HIDEWINDOW) {
delegate_->HandleVisibilityChanged(false);
+ if (direct_manipulation_helper_)
+ direct_manipulation_helper_->Deactivate(hwnd());
+ }
SetMsgHandled(FALSE);
}