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

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

Issue 22555003: GCP2.0 Device: Local settings workflow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | cloud_print/gcp20/prototype/cloud_print_requester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/gcp20/prototype/cloud_print_requester.h
diff --git a/cloud_print/gcp20/prototype/cloud_print_requester.h b/cloud_print/gcp20/prototype/cloud_print_requester.h
index 8e1e46c1226691c547abe28ec8bfe5afe0b90190..ff8306bbf403f2217f9484f48822eeb221e22191 100644
--- a/cloud_print/gcp20/prototype/cloud_print_requester.h
+++ b/cloud_print/gcp20/prototype/cloud_print_requester.h
@@ -14,6 +14,7 @@
#include "base/values.h"
#include "cloud_print/gcp20/prototype/cloud_print_request.h"
#include "cloud_print/gcp20/prototype/cloud_print_response_parser.h"
+#include "cloud_print/gcp20/prototype/local_settings.h"
#include "google_apis/gaia/gaia_oauth_client.h"
class CloudPrintURLRequestContextGetter;
@@ -79,6 +80,14 @@ class CloudPrintRequester : public base::SupportsWeakPtr<CloudPrintRequester>,
// Invoked when printjob is marked as done on CloudPrint server.
virtual void OnPrintJobDone() = 0;
+
+ // Invoked when local settings response was received.
+ virtual void OnLocalSettingsReceived(
+ LocalSettings::State state,
+ const LocalSettings& settings) = 0;
+
+ // Invoked when CURRENT local settings was updated on server.
+ virtual void OnLocalSettingsUpdated() = 0;
};
// Creates and initializes object.
@@ -94,7 +103,9 @@ class CloudPrintRequester : public base::SupportsWeakPtr<CloudPrintRequester>,
// Creates query to server for starting registration.
void StartRegistration(const std::string& proxy_id,
const std::string& device_name,
- const std::string& user, const std::string& cdd);
+ const std::string& user,
+ const LocalSettings& settings,
+ const std::string& cdd);
// Creates request for completing registration and receiving refresh token.
void CompleteRegistration();
@@ -112,6 +123,13 @@ class CloudPrintRequester : public base::SupportsWeakPtr<CloudPrintRequester>,
// Reports server that printjob has been printed.
void SendPrintJobDone(const std::string& job_id);
+ // Requests /printer API to receive local settings.
+ void RequestLocalSettings(const std::string& device_id);
+
+ // Updates local settings on server.
+ void SendLocalSettings(const std::string& device_id,
+ const LocalSettings& settings);
+
private:
typedef base::Callback<void(const std::string&)> ParserCallback;
@@ -166,6 +184,12 @@ class CloudPrintRequester : public base::SupportsWeakPtr<CloudPrintRequester>,
// Invoked after marking printjob as IN_PROGRESS.
void ParsePrintJobInProgress(const std::string& response);
+ // Invoked after receiving local_settings.
+ void ParseLocalSettings(const std::string& response);
+
+ // Invoked after updating current local_settings.
+ void ParseLocalSettingUpdated(const std::string& response);
+
// |request| contains |NULL| if no server response is awaiting. Otherwise wait
// until callback will be called will be called and close connection.
scoped_ptr<CloudPrintRequest> request_;
« no previous file with comments | « no previous file | cloud_print/gcp20/prototype/cloud_print_requester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698