diff options
author | maksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-16 10:22:58 +0000 |
---|---|---|
committer | maksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-16 10:22:58 +0000 |
commit | b2d467cc630c6c0c9c8d004e610c704bb8ac07b9 (patch) | |
tree | 85fb288f9f7114eddc69da17cf31bf36f121a683 /cloud_print/gcp20/prototype/printer.h | |
parent | 3371e50258c7966c4f0c9570c9e18d78305ba0b9 (diff) | |
download | chromium_src-b2d467cc630c6c0c9c8d004e610c704bb8ac07b9.zip chromium_src-b2d467cc630c6c0c9c8d004e610c704bb8ac07b9.tar.gz chromium_src-b2d467cc630c6c0c9c8d004e610c704bb8ac07b9.tar.bz2 |
GCP2.0 Device: Local settings management.
BUG=
Review URL: https://chromiumcodereview.appspot.com/22555003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217989 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print/gcp20/prototype/printer.h')
-rw-r--r-- | cloud_print/gcp20/prototype/printer.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/cloud_print/gcp20/prototype/printer.h b/cloud_print/gcp20/prototype/printer.h index b4ee260..46a6348 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); }; |