Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2931443003: Add support for Android spellcheck menu in Chrome/WebViews (Closed)
Patch Set: Respond to latest comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index eccb5f84ea37b415927e82036214eb5bdf78ffcc..dfce27575161cb258dbd58129ea7f54499f22a13 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -38,6 +38,7 @@
#include "core/editing/VisibleSelection.h"
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/markers/DocumentMarkerController.h"
+#include "core/editing/suggestion/TextSuggestionController.h"
#include "core/events/Event.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/LocalFrameView.h"
@@ -343,7 +344,8 @@ bool SelectionController::HandleSingleClick(
}
bool is_handle_visible = false;
- if (HasEditableStyle(*inner_node)) {
+ const bool has_editable_style = HasEditableStyle(*inner_node);
+ if (has_editable_style) {
const bool is_text_box_empty =
CreateVisibleSelection(SelectionInFlatTree::Builder()
.SelectAllChildren(*inner_node)
@@ -365,6 +367,12 @@ bool SelectionController::HandleSingleClick(
TextGranularity::kCharacter,
is_handle_visible ? HandleVisibility::kVisible
: HandleVisibility::kNotVisible);
+
+ if (has_editable_style && event.Event().FromTouch()) {
+ frame_->GetTextSuggestionController().HandlePotentialMisspelledWordTap(
+ visible_pos);
+ }
+
return false;
}

Powered by Google App Engine
This is Rietveld 408576698