OLD | NEW |
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 Loading... |
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 result.replacement = replacement; | 42 |
| 43 Vector<String> replacements_vec; |
| 44 for (const WebString& replacement : replacements) { |
| 45 replacements_vec.push_back(replacement); |
| 46 } |
| 47 result.replacements = replacements_vec; |
| 48 |
43 if (result.decoration == kTextDecorationTypeGrammar) { | 49 if (result.decoration == kTextDecorationTypeGrammar) { |
44 GrammarDetail detail; | 50 GrammarDetail detail; |
45 detail.location = 0; | 51 detail.location = 0; |
46 detail.length = length; | 52 detail.length = length; |
47 detail.user_description = replacement; | 53 detail.user_description = replacements.empty() ? "" : replacements[0]; |
48 result.details.push_back(detail); | 54 result.details.push_back(detail); |
49 } | 55 } |
50 | 56 |
51 return result; | 57 return result; |
52 } | 58 } |
53 | 59 |
54 } // namespace blink | 60 } // namespace blink |
OLD | NEW |