| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GCP20_PROTOTYPE_PRINTER_H_ | 5 #ifndef GCP20_PROTOTYPE_PRINTER_H_ |
| 6 #define GCP20_PROTOTYPE_PRINTER_H_ | 6 #define GCP20_PROTOTYPE_PRINTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 NOT_CONFIGURED, | 48 NOT_CONFIGURED, |
| 49 OFFLINE, | 49 OFFLINE, |
| 50 ONLINE, | 50 ONLINE, |
| 51 CONNECTING | 51 CONNECTING |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 std::string GetRawCdd(); | 54 std::string GetRawCdd(); |
| 55 | 55 |
| 56 // PrivetHttpServer::Delegate methods: | 56 // PrivetHttpServer::Delegate methods: |
| 57 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationStart( | 57 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationStart( |
| 58 const std::string& user) OVERRIDE; | 58 const std::string& user) override; |
| 59 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationGetClaimToken( | 59 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationGetClaimToken( |
| 60 const std::string& user, | 60 const std::string& user, |
| 61 std::string* token, | 61 std::string* token, |
| 62 std::string* claim_url) OVERRIDE; | 62 std::string* claim_url) override; |
| 63 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationComplete( | 63 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationComplete( |
| 64 const std::string& user, | 64 const std::string& user, |
| 65 std::string* device_id) OVERRIDE; | 65 std::string* device_id) override; |
| 66 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationCancel( | 66 virtual PrivetHttpServer::RegistrationErrorStatus RegistrationCancel( |
| 67 const std::string& user) OVERRIDE; | 67 const std::string& user) override; |
| 68 virtual void GetRegistrationServerError(std::string* description) OVERRIDE; | 68 virtual void GetRegistrationServerError(std::string* description) override; |
| 69 virtual void CreateInfo(PrivetHttpServer::DeviceInfo* info) OVERRIDE; | 69 virtual void CreateInfo(PrivetHttpServer::DeviceInfo* info) override; |
| 70 virtual bool IsRegistered() const OVERRIDE; | 70 virtual bool IsRegistered() const override; |
| 71 virtual bool IsLocalPrintingAllowed() const OVERRIDE; | 71 virtual bool IsLocalPrintingAllowed() const override; |
| 72 virtual bool CheckXPrivetTokenHeader(const std::string& token) const OVERRIDE; | 72 virtual bool CheckXPrivetTokenHeader(const std::string& token) const override; |
| 73 virtual const base::DictionaryValue& GetCapabilities() OVERRIDE; | 73 virtual const base::DictionaryValue& GetCapabilities() override; |
| 74 virtual LocalPrintJob::CreateResult CreateJob( | 74 virtual LocalPrintJob::CreateResult CreateJob( |
| 75 const std::string& ticket, | 75 const std::string& ticket, |
| 76 std::string* job_id, | 76 std::string* job_id, |
| 77 int* expires_in, | 77 int* expires_in, |
| 78 int* error_timeout, | 78 int* error_timeout, |
| 79 std::string* error_description) OVERRIDE; | 79 std::string* error_description) override; |
| 80 virtual LocalPrintJob::SaveResult SubmitDoc( | 80 virtual LocalPrintJob::SaveResult SubmitDoc( |
| 81 const LocalPrintJob& job, | 81 const LocalPrintJob& job, |
| 82 std::string* job_id, | 82 std::string* job_id, |
| 83 int* expires_in, | 83 int* expires_in, |
| 84 std::string* error_description, | 84 std::string* error_description, |
| 85 int* timeout) OVERRIDE; | 85 int* timeout) override; |
| 86 virtual LocalPrintJob::SaveResult SubmitDocWithId( | 86 virtual LocalPrintJob::SaveResult SubmitDocWithId( |
| 87 const LocalPrintJob& job, | 87 const LocalPrintJob& job, |
| 88 const std::string& job_id, | 88 const std::string& job_id, |
| 89 int* expires_in, | 89 int* expires_in, |
| 90 std::string* error_description, | 90 std::string* error_description, |
| 91 int* timeout) OVERRIDE; | 91 int* timeout) override; |
| 92 virtual bool GetJobState(const std::string& id, | 92 virtual bool GetJobState(const std::string& id, |
| 93 LocalPrintJob::Info* info) OVERRIDE; | 93 LocalPrintJob::Info* info) override; |
| 94 | 94 |
| 95 // CloudRequester::Delegate methods: | 95 // CloudRequester::Delegate methods: |
| 96 virtual void OnRegistrationStartResponseParsed( | 96 virtual void OnRegistrationStartResponseParsed( |
| 97 const std::string& registration_token, | 97 const std::string& registration_token, |
| 98 const std::string& complete_invite_url, | 98 const std::string& complete_invite_url, |
| 99 const std::string& device_id) OVERRIDE; | 99 const std::string& device_id) override; |
| 100 virtual void OnRegistrationFinished( | 100 virtual void OnRegistrationFinished( |
| 101 const std::string& refresh_token, | 101 const std::string& refresh_token, |
| 102 const std::string& access_token, | 102 const std::string& access_token, |
| 103 int access_token_expires_in_seconds) OVERRIDE; | 103 int access_token_expires_in_seconds) override; |
| 104 virtual void OnXmppJidReceived(const std::string& xmpp_jid) OVERRIDE; | 104 virtual void OnXmppJidReceived(const std::string& xmpp_jid) override; |
| 105 virtual void OnAccesstokenReceviced(const std::string& access_token, | 105 virtual void OnAccesstokenReceviced(const std::string& access_token, |
| 106 int expires_in_seconds) OVERRIDE; | 106 int expires_in_seconds) override; |
| 107 virtual void OnRegistrationError(const std::string& description) OVERRIDE; | 107 virtual void OnRegistrationError(const std::string& description) override; |
| 108 virtual void OnNetworkError() OVERRIDE; | 108 virtual void OnNetworkError() override; |
| 109 virtual void OnServerError(const std::string& description) OVERRIDE; | 109 virtual void OnServerError(const std::string& description) override; |
| 110 virtual void OnAuthError() OVERRIDE; | 110 virtual void OnAuthError() override; |
| 111 virtual std::string GetAccessToken() OVERRIDE; | 111 virtual std::string GetAccessToken() override; |
| 112 virtual void OnPrintJobsAvailable( | 112 virtual void OnPrintJobsAvailable( |
| 113 const std::vector<cloud_print_response_parser::Job>& jobs) OVERRIDE; | 113 const std::vector<cloud_print_response_parser::Job>& jobs) override; |
| 114 virtual void OnPrintJobDownloaded( | 114 virtual void OnPrintJobDownloaded( |
| 115 const cloud_print_response_parser::Job& job) OVERRIDE; | 115 const cloud_print_response_parser::Job& job) override; |
| 116 virtual void OnPrintJobDone() OVERRIDE; | 116 virtual void OnPrintJobDone() override; |
| 117 virtual void OnLocalSettingsReceived( | 117 virtual void OnLocalSettingsReceived( |
| 118 LocalSettings::State state, | 118 LocalSettings::State state, |
| 119 const LocalSettings& settings) OVERRIDE; | 119 const LocalSettings& settings) override; |
| 120 virtual void OnLocalSettingsUpdated() OVERRIDE; | 120 virtual void OnLocalSettingsUpdated() override; |
| 121 | 121 |
| 122 // CloudPrintXmppListener::Delegate methods: | 122 // CloudPrintXmppListener::Delegate methods: |
| 123 virtual void OnXmppConnected() OVERRIDE; | 123 virtual void OnXmppConnected() override; |
| 124 virtual void OnXmppAuthError() OVERRIDE; | 124 virtual void OnXmppAuthError() override; |
| 125 virtual void OnXmppNetworkError() OVERRIDE; | 125 virtual void OnXmppNetworkError() override; |
| 126 virtual void OnXmppNewPrintJob(const std::string& device_id) OVERRIDE; | 126 virtual void OnXmppNewPrintJob(const std::string& device_id) override; |
| 127 virtual void OnXmppNewLocalSettings(const std::string& device_id) OVERRIDE; | 127 virtual void OnXmppNewLocalSettings(const std::string& device_id) override; |
| 128 virtual void OnXmppDeleteNotification(const std::string& device_id) OVERRIDE; | 128 virtual void OnXmppDeleteNotification(const std::string& device_id) override; |
| 129 | 129 |
| 130 // Method for trying to reconnecting to server on start or after network fail. | 130 // Method for trying to reconnecting to server on start or after network fail. |
| 131 void TryConnect(); | 131 void TryConnect(); |
| 132 | 132 |
| 133 // Connects XMPP. | 133 // Connects XMPP. |
| 134 void ConnectXmpp(); | 134 void ConnectXmpp(); |
| 135 | 135 |
| 136 // Method to handle pending events. | 136 // Method to handle pending events. |
| 137 // Do *NOT* call this method instantly. Only with |PostOnIdle|. | 137 // Do *NOT* call this method instantly. Only with |PostOnIdle|. |
| 138 void OnIdle(); | 138 void OnIdle(); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 bool pending_print_jobs_check_; | 248 bool pending_print_jobs_check_; |
| 249 | 249 |
| 250 // Contains |true| if Printer has to be deleted. | 250 // Contains |true| if Printer has to be deleted. |
| 251 bool pending_deletion_; | 251 bool pending_deletion_; |
| 252 | 252 |
| 253 DISALLOW_COPY_AND_ASSIGN(Printer); | 253 DISALLOW_COPY_AND_ASSIGN(Printer); |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 #endif // GCP20_PROTOTYPE_PRINTER_H_ | 256 #endif // GCP20_PROTOTYPE_PRINTER_H_ |
| 257 | 257 |
| OLD | NEW |