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

Side by Side Diff: content/shell/test_runner/spell_check_client.cc

Issue 2799563002: Replace usage of WebVector::isEmpty with WebVector::empty().
Patch Set: Created 3 years, 8 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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | media/blink/key_system_config_selector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/test_runner/spell_check_client.h" 5 #include "content/shell/test_runner/spell_check_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (!misspelled_length) 108 if (!misspelled_length)
109 break; 109 break;
110 blink::WebVector<blink::WebString> suggestions; 110 blink::WebVector<blink::WebString> suggestions;
111 spell_check_.FillSuggestionList( 111 spell_check_.FillSuggestionList(
112 blink::WebString::fromUTF16( 112 blink::WebString::fromUTF16(
113 text.substr(misspelled_position, misspelled_length)), 113 text.substr(misspelled_position, misspelled_length)),
114 &suggestions); 114 &suggestions);
115 results.push_back(blink::WebTextCheckingResult( 115 results.push_back(blink::WebTextCheckingResult(
116 blink::WebTextDecorationTypeSpelling, offset + misspelled_position, 116 blink::WebTextDecorationTypeSpelling, offset + misspelled_position,
117 misspelled_length, 117 misspelled_length,
118 suggestions.isEmpty() ? blink::WebString() : suggestions[0])); 118 suggestions.empty() ? blink::WebString() : suggestions[0]));
119 text = text.substr(misspelled_position + misspelled_length); 119 text = text.substr(misspelled_position + misspelled_length);
120 offset += misspelled_position + misspelled_length; 120 offset += misspelled_position + misspelled_length;
121 } 121 }
122 MockGrammarCheck::CheckGrammarOfString(last_requested_text_check_string_, 122 MockGrammarCheck::CheckGrammarOfString(last_requested_text_check_string_,
123 &results); 123 &results);
124 } 124 }
125 last_requested_text_checking_completion_->didFinishCheckingText(results); 125 last_requested_text_checking_completion_->didFinishCheckingText(results);
126 last_requested_text_checking_completion_ = 0; 126 last_requested_text_checking_completion_ = 0;
127 RequestResolved(); 127 RequestResolved();
128 128
(...skipping 26 matching lines...) Expand all
155 return; 155 return;
156 156
157 v8::Context::Scope context_scope(context); 157 v8::Context::Scope context_scope(context);
158 158
159 frame->callFunctionEvenIfScriptDisabled( 159 frame->callFunctionEvenIfScriptDisabled(
160 v8::Local<v8::Function>::New(isolate, resolved_callback_), 160 v8::Local<v8::Function>::New(isolate, resolved_callback_),
161 context->Global(), 0, nullptr); 161 context->Global(), 0, nullptr);
162 } 162 }
163 163
164 } // namespace test_runner 164 } // namespace test_runner
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | media/blink/key_system_config_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698