Add failure handling in direct manipulation initialization
Some Windows API calls in direct manipulation initialization without failure handling. In this case, we may handle event stream in an incorrect direct manipulation window. Bug: 914914 Change-Id: Ic35338deaf62938dd59a356d5a74dab5c2bf9f54 Reviewed-on: https://chromium-review.googlesource.com/c/1455061 Reviewed-by: Scott Violet <sky@chromium.org> Commit-Queue: Jianpeng Chao <chaopeng@chromium.org> Cr-Commit-Position: refs/heads/master@{#629365}
This commit is contained in:
@ -114,8 +114,6 @@ bool DirectManipulationHelper::Initialize(WindowEventTarget* event_target) {
|
||||
|
||||
event_handler_ =
|
||||
Microsoft::WRL::Make<DirectManipulationHandler>(this, event_target);
|
||||
if (!SUCCEEDED(hr))
|
||||
return false;
|
||||
|
||||
// We got Direct Manipulation transform from
|
||||
// IDirectManipulationViewportEventHandler.
|
||||
@ -131,10 +129,15 @@ bool DirectManipulationHelper::Initialize(WindowEventTarget* event_target) {
|
||||
if (!SUCCEEDED(hr))
|
||||
return false;
|
||||
|
||||
manager_->Activate(window_);
|
||||
hr = manager_->Activate(window_);
|
||||
if (!SUCCEEDED(hr))
|
||||
return false;
|
||||
|
||||
hr = viewport_->Enable();
|
||||
update_manager_->Update(nullptr);
|
||||
if (!SUCCEEDED(hr))
|
||||
return false;
|
||||
|
||||
hr = update_manager_->Update(nullptr);
|
||||
if (!SUCCEEDED(hr))
|
||||
return false;
|
||||
|
||||
|
Reference in New Issue
Block a user