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

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

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 // Support utilities for the JSON automation interface used by PyAuto. 5 // Support utilities for the JSON automation interface used by PyAuto.
6 6
7 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ 7 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_
8 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ 8 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_
9 #pragma once 9 #pragma once
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "chrome/browser/automation/automation_provider.h"
14
15 class Value; 13 class Value;
14 class AutomationProvider;
16 15
17 namespace IPC { 16 namespace IPC {
18 class Message; 17 class Message;
19 } 18 }
20 19
21 // Helper to ensure we always send a reply message for JSON automation requests. 20 // Helper to ensure we always send a reply message for JSON automation requests.
22 class AutomationJSONReply { 21 class AutomationJSONReply {
23 public: 22 public:
24 // Creates a new reply object for the IPC message |reply_message| for 23 // Creates a new reply object for the IPC message |reply_message| for
25 // |provider|. The caller is expected to call SendSuccess() or SendError() 24 // |provider|. The caller is expected to call SendSuccess() or SendError()
26 // before destroying this object. 25 // before destroying this object.
27 AutomationJSONReply(AutomationProvider* provider, 26 AutomationJSONReply(AutomationProvider* provider,
28 IPC::Message* reply_message); 27 IPC::Message* reply_message);
29 28
30 ~AutomationJSONReply(); 29 ~AutomationJSONReply();
31 30
32 // Send a success reply along with data contained in |value|. 31 // Send a success reply along with data contained in |value|.
33 // An empty message will be sent if |value| is NULL. 32 // An empty message will be sent if |value| is NULL.
34 void SendSuccess(const Value* value); 33 void SendSuccess(const Value* value);
35 34
36 // Send an error reply along with error message |error_message|. 35 // Send an error reply along with error message |error_message|.
37 void SendError(const std::string& error_message); 36 void SendError(const std::string& error_message);
38 37
39 private: 38 private:
40 AutomationProvider* provider_; 39 AutomationProvider* provider_;
41 IPC::Message* message_; 40 IPC::Message* message_;
42 }; 41 };
43 42
44 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ 43 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/automation/automation_provider_json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698