1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_RESPONSE_PARSER_H_
6 #define CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_RESPONSE_PARSER_H_
11 #include "base/callback.h"
12 #include "base/time/time.h"
13 #include "cloud_print/gcp20/prototype/local_settings.h"
17 class DictionaryValue;
21 namespace cloud_print_response_parser {
28 base::Time create_time;
30 std::string ticket_url;
38 // Parses CloudPrint register start response to out parameters.
39 // Returns |true| on success.
40 bool ParseRegisterStartResponse(const std::string& response,
41 std::string* error_description,
42 std::string* polling_url,
43 std::string* registration_token,
44 std::string* complete_invite_url,
45 std::string* device_id);
47 // Parses CloudPrint register complete response to out parameters.
48 // Returns |true| on success.
49 bool ParseRegisterCompleteResponse(const std::string& response,
50 std::string* error_description,
51 std::string* authorization_code,
52 std::string* xmpp_jid);
54 // Parses CloudPrint fetch response to out parameters.
55 // Returns |true| on success.
56 bool ParseFetchResponse(const std::string& response,
57 std::string* error_description,
58 std::vector<Job>* list);
60 // Parses CloudPrint printer response to get Local Settings.
61 // Returns |true| on success.
62 bool ParseLocalSettingsResponse(const std::string& response,
63 std::string* error_description,
64 LocalSettings::State* state,
65 LocalSettings* settings);
67 } // namespace cloud_print_response_parser
69 #endif // CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_RESPONSE_PARSER_H_