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

Side by Side Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 100823007: Stop doing unnecessary UTF-8 to UTF-16 conversions in JSONWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "chrome/renderer/searchbox/searchbox_extension.h" 5 #include "chrome/renderer/searchbox/searchbox_extension.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/json/string_escape.h" 8 #include "base/json/string_escape.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 blink::WebScriptSource(kSupportsInstantScript)); 454 blink::WebScriptSource(kSupportsInstantScript));
455 return !v.IsEmpty() && v->BooleanValue(); 455 return !v.IsEmpty() && v->BooleanValue();
456 } 456 }
457 457
458 // static 458 // static
459 void SearchBoxExtension::DispatchChromeIdentityCheckResult( 459 void SearchBoxExtension::DispatchChromeIdentityCheckResult(
460 blink::WebFrame* frame, 460 blink::WebFrame* frame,
461 const base::string16& identity, 461 const base::string16& identity,
462 bool identity_match) { 462 bool identity_match) {
463 std::string escaped_identity; 463 std::string escaped_identity;
464 base::JsonDoubleQuote(identity, true, &escaped_identity); 464 base::EscapeJSONString(identity, true, &escaped_identity);
Mark Mentovai 2013/12/06 15:35:12 Here. In fact, this time, it wanted the quotes to
Robert Sesek 2013/12/09 19:52:09 Done.
465 blink::WebString script(UTF8ToUTF16(base::StringPrintf( 465 blink::WebString script(UTF8ToUTF16(base::StringPrintf(
466 kDispatchChromeIdentityCheckResult, 466 kDispatchChromeIdentityCheckResult,
467 escaped_identity.c_str(), 467 escaped_identity.c_str(),
468 identity_match ? "true" : "false"))); 468 identity_match ? "true" : "false")));
469 Dispatch(frame, script); 469 Dispatch(frame, script);
470 } 470 }
471 471
472 // static 472 // static
473 void SearchBoxExtension::DispatchFocusChange(blink::WebFrame* frame) { 473 void SearchBoxExtension::DispatchFocusChange(blink::WebFrame* frame) {
474 Dispatch(frame, kDispatchFocusChangedScript); 474 Dispatch(frame, kDispatchFocusChangedScript);
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 if (!render_view) return; 1040 if (!render_view) return;
1041 1041
1042 bool display_instant_results = 1042 bool display_instant_results =
1043 SearchBox::Get(render_view)->display_instant_results(); 1043 SearchBox::Get(render_view)->display_instant_results();
1044 DVLOG(1) << render_view << " GetDisplayInstantResults" << 1044 DVLOG(1) << render_view << " GetDisplayInstantResults" <<
1045 display_instant_results; 1045 display_instant_results;
1046 args.GetReturnValue().Set(display_instant_results); 1046 args.GetReturnValue().Set(display_instant_results);
1047 } 1047 }
1048 1048
1049 } // namespace extensions_v8 1049 } // namespace extensions_v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698