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

Unified Diff: chrome/renderer/searchbox_extension.cc

Issue 10732002: Upstream rewrite of Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extreme nits. Created 8 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
« no previous file with comments | « chrome/renderer/searchbox.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox_extension.cc b/chrome/renderer/searchbox_extension.cc
index 29bddcfecf0669d5b96f5d5210f016fbc3dda72c..858c12d2c75add8d42d65c550fb4b1041615045d 100644
--- a/chrome/renderer/searchbox_extension.cc
+++ b/chrome/renderer/searchbox_extension.cc
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/command_line.h"
+#include "base/string16.h"
#include "base/string_split.h"
#include "base/stringprintf.h"
#include "chrome/renderer/searchbox.h"
@@ -286,7 +287,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetHeight(
// static
v8::Handle<v8::Value> SearchBoxExtensionWrapper::SetSuggestions(
const v8::Arguments& args) {
- std::vector<std::string> suggestions;
+ std::vector<string16> suggestions;
InstantCompleteBehavior behavior = INSTANT_COMPLETE_NOW;
if (args.Length() && args[0]->IsArray()) {
@@ -296,8 +297,8 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::SetSuggestions(
v8::Local<v8::Array>::Cast(args[0]);
uint32_t length = suggestions_array->Length();
for (uint32_t i = 0; i < length; i++) {
- std::string suggestion = *v8::String::Utf8Value(
- suggestions_array->Get(v8::Integer::New(i))->ToString());
+ string16 suggestion(reinterpret_cast<char16*>(*v8::String::Value(
+ suggestions_array->Get(v8::Integer::New(i))->ToString())));
if (!suggestion.length()) continue;
suggestions.push_back(suggestion);
}
@@ -324,8 +325,8 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::SetSuggestions(
suggestion_object->Get(v8::String::New("value"));
if (!suggestion_object_value->IsString()) continue;
- std::string suggestion = *v8::String::Utf8Value(
- suggestion_object_value->ToString());
+ string16 suggestion(reinterpret_cast<char16*>(*v8::String::Value(
+ suggestion_object_value->ToString())));
if (!suggestion.length()) continue;
suggestions.push_back(suggestion);
}
« no previous file with comments | « chrome/renderer/searchbox.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698