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

Side by Side Diff: third_party/WebKit/Source/web/WebTextCheckingResult.cpp

Issue 2906243002: Revert of Allow storing multiple replacements on SpellCheckResult (Closed)
Patch Set: Revert "Allow storing multiple replacements on SpellCheckResult" Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 21 matching lines...) Expand all
32 32
33 #include "platform/text/TextCheckerClient.h" 33 #include "platform/text/TextCheckerClient.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 WebTextCheckingResult::operator TextCheckingResult() const { 37 WebTextCheckingResult::operator TextCheckingResult() const {
38 TextCheckingResult result; 38 TextCheckingResult result;
39 result.decoration = static_cast<TextDecorationType>(decoration); 39 result.decoration = static_cast<TextDecorationType>(decoration);
40 result.location = location; 40 result.location = location;
41 result.length = length; 41 result.length = length;
42 42 result.replacement = replacement;
43 Vector<String> replacements_vec;
44 for (const WebString& replacement : replacements) {
45 replacements_vec.push_back(replacement);
46 }
47 result.replacements = replacements_vec;
48
49 if (result.decoration == kTextDecorationTypeGrammar) { 43 if (result.decoration == kTextDecorationTypeGrammar) {
50 GrammarDetail detail; 44 GrammarDetail detail;
51 detail.location = 0; 45 detail.location = 0;
52 detail.length = length; 46 detail.length = length;
53 detail.user_description = replacements.empty() ? "" : replacements[0]; 47 detail.user_description = replacement;
54 result.details.push_back(detail); 48 result.details.push_back(detail);
55 } 49 }
56 50
57 return result; 51 return result;
58 } 52 }
59 53
60 } // namespace blink 54 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/text/TextChecking.h ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698