Commit dfbb726b authored by Li Zhao's avatar Li Zhao Committed by Commit Bot

Always allow call to setDraggableArea.

Virtual keyboard's extension may call this function when controller has
been destroyed(when system switch from virtual keyboard to physical
keyboard) or in full width mode, no need to throw exception in these
cases.

Bug: 825709
Change-Id: I8e565f7b090f619d08814af55450ad0f437486cd
Reviewed-on: https://chromium-review.googlesource.com/994497Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Commit-Queue: Li Zhao <iloahz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548002}
parent a8e6a87d
...@@ -192,8 +192,10 @@ bool ChromeVirtualKeyboardDelegate::SetDraggableArea( ...@@ -192,8 +192,10 @@ bool ChromeVirtualKeyboardDelegate::SetDraggableArea(
const api::virtual_keyboard_private::Bounds& rect) { const api::virtual_keyboard_private::Bounds& rect) {
keyboard::KeyboardController* controller = keyboard::KeyboardController* controller =
keyboard::KeyboardController::GetInstance(); keyboard::KeyboardController::GetInstance();
// Since controller will be destroyed when system switch from VK to
// physical keyboard, return true to avoid unneccessary exception.
if (!controller) if (!controller)
return false; return true;
return controller->SetDraggableArea( return controller->SetDraggableArea(
gfx::Rect(rect.top, rect.left, rect.width, rect.height)); gfx::Rect(rect.top, rect.left, rect.width, rect.height));
} }
......
...@@ -120,7 +120,10 @@ bool ContainerFullWidthBehavior::BoundsAffectWorkspaceLayout() const { ...@@ -120,7 +120,10 @@ bool ContainerFullWidthBehavior::BoundsAffectWorkspaceLayout() const {
} }
bool ContainerFullWidthBehavior::SetDraggableArea(const gfx::Rect& rect) { bool ContainerFullWidthBehavior::SetDraggableArea(const gfx::Rect& rect) {
return false; // Allow extension to call this function but does nothing here.
// To avoid unnecessary exception when VK calls this function to
// clear draggable area in full width mode.
return true;
} }
} // namespace keyboard } // namespace keyboard
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment