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

Side by Side Diff: chrome/browser/automation/automation_provider_json.cc

Issue 4758001: Part 2 of reapplying r64637. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Window recompile after rebase? Created 10 years, 1 month 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser/automation/automation_provider_json.h" 5 #include "chrome/browser/automation/automation_provider_json.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/json/string_escape.h" 8 #include "base/json/string_escape.h"
9 #include "chrome/browser/autocomplete/autocomplete_match.h" 9 #include "chrome/browser/autocomplete/autocomplete_match.h"
10 #include "chrome/browser/automation/automation_provider.h" 10 #include "chrome/browser/automation/automation_provider.h"
11 #include "chrome/test/automation/automation_messages.h" 11 #include "chrome/common/automation_messages.h"
12 12
13 namespace { 13 namespace {
14 14
15 // Util for creating a JSON error return string (dict with key 15 // Util for creating a JSON error return string (dict with key
16 // 'error' and error string value). No need to quote input. 16 // 'error' and error string value). No need to quote input.
17 std::string JSONErrorString(const std::string& err) { 17 std::string JSONErrorString(const std::string& err) {
18 std::string prefix = "{\"error\": \""; 18 std::string prefix = "{\"error\": \"";
19 std::string no_quote_err; 19 std::string no_quote_err;
20 std::string suffix = "\"}"; 20 std::string suffix = "\"}";
21 21
(...skipping 25 matching lines...) Expand all
47 } 47 }
48 48
49 void AutomationJSONReply::SendError(const std::string& error_message) { 49 void AutomationJSONReply::SendError(const std::string& error_message) {
50 DCHECK(message_) << "Resending reply for JSON automation request"; 50 DCHECK(message_) << "Resending reply for JSON automation request";
51 std::string json_string = JSONErrorString(error_message); 51 std::string json_string = JSONErrorString(error_message);
52 AutomationMsg_SendJSONRequest::WriteReplyParams( 52 AutomationMsg_SendJSONRequest::WriteReplyParams(
53 message_, json_string, false); 53 message_, json_string, false);
54 provider_->Send(message_); 54 provider_->Send(message_);
55 message_ = NULL; 55 message_ = NULL;
56 } 56 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_gtk.cc ('k') | chrome/browser/automation/automation_provider_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698