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

Unified Diff: third_party/WebKit/Source/core/page/ContextMenuClient.cpp

Issue 2978823002: [SelectMiss...Async #2] Change ContextMenuClient::SelectMisspellingAsync() to return pair of strings (Closed)
Patch Set: 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/page/ContextMenuClient.cpp
diff --git a/third_party/WebKit/Source/core/page/ContextMenuClient.cpp b/third_party/WebKit/Source/core/page/ContextMenuClient.cpp
index 9f87cba674fb345d002b86468b3a57afed5c9422..a0c2256a93f460d0479af18e77585f14cf09a48d 100644
--- a/third_party/WebKit/Source/core/page/ContextMenuClient.cpp
+++ b/third_party/WebKit/Source/core/page/ContextMenuClient.cpp
@@ -360,9 +360,15 @@ bool ContextMenuClient::ShowContextMenu(const ContextMenu* default_menu,
// suggestions to these markers in the background. Therefore, when a
// user right-clicks a mouse on a word, Chrome just needs to find a
// spelling marker on the word instead of spellchecking it.
- String description;
- data.misspelled_word =
- selected_frame->GetSpellChecker().SelectMisspellingAsync(description);
+ Optional<std::pair<String, String>> misspelled_word_and_description =
+ selected_frame->GetSpellChecker().SelectMisspellingAsync();
+ data.misspelled_word = misspelled_word_and_description
yosin_UTC9 2017/07/20 01:00:54 Because both |data.misspell_word| and |description
+ ? misspelled_word_and_description.value().first
+ : String();
+ const String& description =
+ misspelled_word_and_description
+ ? misspelled_word_and_description.value().second
+ : String();
if (description.length()) {
Vector<String> suggestions;
description.Split('\n', suggestions);

Powered by Google App Engine
This is Rietveld 408576698