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

Unified Diff: cloud_print/gcp20/prototype/cloud_print_response_parser.h

Issue 19866002: GCP2.0 Device: Receiving printjobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@confirmation
Patch Set: static_cast<int> Created 7 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
Index: cloud_print/gcp20/prototype/cloud_print_response_parser.h
diff --git a/cloud_print/gcp20/prototype/cloud_print_response_parser.h b/cloud_print/gcp20/prototype/cloud_print_response_parser.h
index 1178301ab38c4a9ff03ec952eebfb51710a028b1..b691934dc6bfedc09fe9b5f7d999ec6dac1e229f 100644
--- a/cloud_print/gcp20/prototype/cloud_print_response_parser.h
+++ b/cloud_print/gcp20/prototype/cloud_print_response_parser.h
@@ -6,6 +6,7 @@
#define CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_RESPONSE_PARSER_H_
#include <string>
+#include <vector>
#include "base/callback.h"
@@ -17,14 +18,26 @@ class DictionaryValue;
namespace cloud_print_response_parser {
-// Callback for handling parse errors.
-typedef base::Callback<void(const std::string&)> ErrorCallback;
+struct Job {
+ Job();
+ ~Job();
+
+ std::string job_id;
+ std::string create_time;
+ std::string file_url;
+ std::string ticket_url;
+ std::string title;
+
+ // Downloaded data:
+ std::string file;
+ std::string ticket;
+};
// Parses CloudPrint register start response to out parameters.
// Returns |true| on success. Callback is called with description as a parameter
-// when parsing failed.
+// when parsing is failed.
bool ParseRegisterStartResponse(const std::string& response,
- const ErrorCallback error_callback,
+ std::string* error_description,
std::string* polling_url_result,
std::string* registration_token_result,
std::string* complete_invite_url_result,
@@ -32,11 +45,18 @@ bool ParseRegisterStartResponse(const std::string& response,
// Parses CloudPrint register complete response to out parameters.
// Returns |true| on success. Callback is called with description as a parameter
-// when parsing failed.
+// when parsing is failed.
bool ParseRegisterCompleteResponse(const std::string& response,
- const ErrorCallback error_callback,
+ std::string* error_description,
std::string* authorization_code_result);
+// Parses CloudPrint fetch response to out parameters.
+// Returns |true| on success. Callback is called with description as a parameter
+// when parsing is failed.
+bool ParseFetchResponse(const std::string& response,
+ std::string* error_description,
+ std::vector<Job>* list_result);
+
} // namespace cloud_print_response_parser
#endif // CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_RESPONSE_PARSER_H_
« no previous file with comments | « cloud_print/gcp20/prototype/cloud_print_requester.cc ('k') | cloud_print/gcp20/prototype/cloud_print_response_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698