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

Unified Diff: cloud_print/gcp20/prototype/printer.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 | « cloud_print/gcp20/prototype/local_settings.h ('k') | cloud_print/gcp20/prototype/printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/gcp20/prototype/printer.h
diff --git a/cloud_print/gcp20/prototype/printer.h b/cloud_print/gcp20/prototype/printer.h
index b4ee2607764144bea556d2a4f31e1c3e9abc1f26..46a6348690e5bc6edff625659b52dbce34e38db2 100644
--- a/cloud_print/gcp20/prototype/printer.h
+++ b/cloud_print/gcp20/prototype/printer.h
@@ -132,6 +132,10 @@ class Printer : public base::SupportsWeakPtr<Printer>,
virtual void OnPrintJobDownloaded(
const cloud_print_response_parser::Job& job) OVERRIDE;
virtual void OnPrintJobDone() OVERRIDE;
+ virtual void OnLocalSettingsReceived(
+ LocalSettings::State state,
+ const LocalSettings& settings) OVERRIDE;
+ virtual void OnLocalSettingsUpdated() OVERRIDE;
// CloudPrintXmppListener::Delegate methods:
virtual void OnXmppConnected() OVERRIDE;
@@ -151,15 +155,17 @@ class Printer : public base::SupportsWeakPtr<Printer>,
// Do *NOT* call this method instantly. Only with |PostOnIdle|.
void OnIdle();
- // Method for checking printer status.
- // (e.g. printjobs, local settings, deleted status).
- void CheckPendingUpdates();
+ // Ask Cloud Print server for printjobs.
+ void FetchPrintJobs();
- // Ask CloudPrint server for new local sendings.
+ // Ask Cloud Print server for new local sendings.
void GetLocalSettings();
- // Ask CloudPrint server for printjobs.
- void FetchPrintJobs();
+ // Applies new local settings to printer.
+ void ApplyLocalSettings(const LocalSettings& settings);
+
+ // Used for erasing all printer info.
+ void OnPrinterDeleted();
// Saves |access_token| and calculates time for next update.
void RememberAccessToken(const std::string& access_token,
@@ -199,6 +205,11 @@ class Printer : public base::SupportsWeakPtr<Printer>,
// Deletes registration expiration at all.
void InvalidateRegistrationExpiration();
+ // Methods to start HTTP and DNS-SD servers. Return |true| if servers
+ // were started.
+ bool StartHttpServer();
+ bool StartDnsServer();
+
// Converts errors.
PrivetHttpServer::RegistrationErrorStatus ConfirmationToRegistrationError(
RegistrationInfo::ConfirmationState state);
@@ -213,8 +224,13 @@ class Printer : public base::SupportsWeakPtr<Printer>,
// was changed (otherwise state was the same).
bool ChangeState(ConnectionState new_state);
+ // TODO(maksymb): Encapsulate reg_info, local_settings and other state
+ // member variables to struct.
+
RegistrationInfo reg_info_;
+ LocalSettings local_settings_;
+
// Contains DNS-SD server.
DnsSdServer dns_server_;
@@ -253,6 +269,9 @@ class Printer : public base::SupportsWeakPtr<Printer>,
// Contains |true| if Printer has to check available printjobs.
bool pending_print_jobs_check_;
+ // Contains |true| if Printer has to be deleted.
+ bool pending_deletion_;
+
DISALLOW_COPY_AND_ASSIGN(Printer);
};
« no previous file with comments | « cloud_print/gcp20/prototype/local_settings.h ('k') | cloud_print/gcp20/prototype/printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698