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

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

Issue 3412016: FBTF: Move a bunch of code to the headers and remove includes. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Rebase + fixed windows issues locally Created 10 years, 3 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 (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/automation/automation_provider.h"
9 #include "chrome/test/automation/automation_messages.h" 10 #include "chrome/test/automation/automation_messages.h"
10 11
11 namespace { 12 namespace {
12 13
13 // Util for creating a JSON error return string (dict with key 14 // Util for creating a JSON error return string (dict with key
14 // 'error' and error string value). No need to quote input. 15 // 'error' and error string value). No need to quote input.
15 std::string JSONErrorString(const std::string& err) { 16 std::string JSONErrorString(const std::string& err) {
16 std::string prefix = "{\"error\": \""; 17 std::string prefix = "{\"error\": \"";
17 std::string no_quote_err; 18 std::string no_quote_err;
18 std::string suffix = "\"}"; 19 std::string suffix = "\"}";
(...skipping 27 matching lines...) Expand all
46 47
47 void AutomationJSONReply::SendError(const std::string& error_message) { 48 void AutomationJSONReply::SendError(const std::string& error_message) {
48 DCHECK(message_) << "Resending reply for JSON automation request"; 49 DCHECK(message_) << "Resending reply for JSON automation request";
49 std::string json_string = JSONErrorString(error_message); 50 std::string json_string = JSONErrorString(error_message);
50 AutomationMsg_SendJSONRequest::WriteReplyParams( 51 AutomationMsg_SendJSONRequest::WriteReplyParams(
51 message_, json_string, false); 52 message_, json_string, false);
52 provider_->Send(message_); 53 provider_->Send(message_);
53 message_ = NULL; 54 message_ = NULL;
54 } 55 }
55 56
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_json.h ('k') | chrome/browser/automation/automation_provider_observers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698