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

Side by Side Diff: content/shell/renderer/test_runner/event_sender.cc

Issue 410283003: test_runner: Migrate MockSpellCheck to Chromium C++ style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Build.gn Created 6 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 unified diff | Download patch
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/renderer/test_runner/event_sender.h" 5 #include "content/shell/renderer/test_runner/event_sender.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "content/public/common/page_zoom.h" 10 #include "content/public/common/page_zoom.h"
11 #include "content/shell/renderer/test_runner/MockSpellCheck.h"
12 #include "content/shell/renderer/test_runner/TestInterfaces.h" 11 #include "content/shell/renderer/test_runner/TestInterfaces.h"
13 #include "content/shell/renderer/test_runner/WebTestDelegate.h" 12 #include "content/shell/renderer/test_runner/WebTestDelegate.h"
13 #include "content/shell/renderer/test_runner/mock_spell_check.h"
14 #include "content/shell/renderer/test_runner/web_test_proxy.h" 14 #include "content/shell/renderer/test_runner/web_test_proxy.h"
15 #include "gin/handle.h" 15 #include "gin/handle.h"
16 #include "gin/object_template_builder.h" 16 #include "gin/object_template_builder.h"
17 #include "gin/wrappable.h" 17 #include "gin/wrappable.h"
18 #include "third_party/WebKit/public/platform/WebString.h" 18 #include "third_party/WebKit/public/platform/WebString.h"
19 #include "third_party/WebKit/public/platform/WebVector.h" 19 #include "third_party/WebKit/public/platform/WebVector.h"
20 #include "third_party/WebKit/public/web/WebContextMenuData.h" 20 #include "third_party/WebKit/public/web/WebContextMenuData.h"
21 #include "third_party/WebKit/public/web/WebFrame.h" 21 #include "third_party/WebKit/public/web/WebFrame.h"
22 #include "third_party/WebKit/public/web/WebKit.h" 22 #include "third_party/WebKit/public/web/WebKit.h"
23 #include "third_party/WebKit/public/web/WebView.h" 23 #include "third_party/WebKit/public/web/WebView.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (!context_menu) 170 if (!context_menu)
171 return std::vector<std::string>(); 171 return std::vector<std::string>();
172 172
173 std::vector<std::string> strings; 173 std::vector<std::string> strings;
174 174
175 if (context_menu->isEditable) { 175 if (context_menu->isEditable) {
176 for (const char** item = kEditableMenuStrings; *item; ++item) { 176 for (const char** item = kEditableMenuStrings; *item; ++item) {
177 strings.push_back(*item); 177 strings.push_back(*item);
178 } 178 }
179 WebVector<WebString> suggestions; 179 WebVector<WebString> suggestions;
180 MockSpellCheck::fillSuggestionList( 180 MockSpellCheck::FillSuggestionList(context_menu->misspelledWord,
181 context_menu->misspelledWord, &suggestions); 181 &suggestions);
182 for (size_t i = 0; i < suggestions.size(); ++i) { 182 for (size_t i = 0; i < suggestions.size(); ++i) {
183 strings.push_back(suggestions[i].utf8()); 183 strings.push_back(suggestions[i].utf8());
184 } 184 }
185 } else { 185 } else {
186 for (const char** item = kNonEditableMenuStrings; *item; ++item) { 186 for (const char** item = kNonEditableMenuStrings; *item; ++item) {
187 strings.push_back(*item); 187 strings.push_back(*item);
188 } 188 }
189 } 189 }
190 190
191 return strings; 191 return strings;
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 } 2258 }
2259 default: 2259 default:
2260 NOTREACHED(); 2260 NOTREACHED();
2261 } 2261 }
2262 } 2262 }
2263 2263
2264 replaying_saved_events_ = false; 2264 replaying_saved_events_ = false;
2265 } 2265 }
2266 2266
2267 } // namespace content 2267 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/SpellCheckClient.cpp ('k') | content/shell/renderer/test_runner/mock_spell_check.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698