Commit eb8d3afd authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

Fix segfault in VR with Top Document Isolation on.

The touch selection controller may be null on Android for a few reasons,
one of which is that selection is disabled in VR currently.

Bug: 822374
Change-Id: Ie19fc8a4b148f64dc0fda391a45e758940d39154
Reviewed-on: https://chromium-review.googlesource.com/963680Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543726}
parent 353fc9f1
...@@ -71,8 +71,10 @@ void TouchSelectionControllerClientManagerAndroid::UpdateClientSelectionBounds( ...@@ -71,8 +71,10 @@ void TouchSelectionControllerClientManagerAndroid::UpdateClientSelectionBounds(
// Notify TouchSelectionController if anything should change here. Only // Notify TouchSelectionController if anything should change here. Only
// update if the client is different and not making a change to empty, or // update if the client is different and not making a change to empty, or
// is the same client. // is the same client.
if (GetTouchSelectionController()) {
GetTouchSelectionController()->OnSelectionBoundsChanged( GetTouchSelectionController()->OnSelectionBoundsChanged(
manager_selection_start_, manager_selection_end_); manager_selection_start_, manager_selection_end_);
}
} }
void TouchSelectionControllerClientManagerAndroid::InvalidateClient( void TouchSelectionControllerClientManagerAndroid::InvalidateClient(
......
...@@ -55,7 +55,7 @@ class CONTENT_EXPORT TouchSelectionControllerClientManager { ...@@ -55,7 +55,7 @@ class CONTENT_EXPORT TouchSelectionControllerClientManager {
virtual void InvalidateClient(ui::TouchSelectionControllerClient* client) = 0; virtual void InvalidateClient(ui::TouchSelectionControllerClient* client) = 0;
// Provides direct access to the TouchSelectionController that will be used // Provides direct access to the TouchSelectionController that will be used
// with all clients accessing this manager. Always returns non-null value. // with all clients accessing this manager. May return null values on Android.
virtual ui::TouchSelectionController* GetTouchSelectionController() = 0; virtual ui::TouchSelectionController* GetTouchSelectionController() = 0;
// The following two functions allow clients (or their owners, etc.) to // The following two functions allow clients (or their owners, etc.) to
......
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