diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 19:09:33 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 19:09:33 +0000 |
commit | b6c98a837a4af01daeaf36cf4beaa170c33df417 (patch) | |
tree | a36ffa952f27a3ac0424a880276d96b893ac78dd /chrome/service/cloud_print/printer_job_handler.cc | |
parent | 84e6824ab0c0b979c7f9eee493f1057cef419fa7 (diff) | |
download | chromium_src-b6c98a837a4af01daeaf36cf4beaa170c33df417.zip chromium_src-b6c98a837a4af01daeaf36cf4beaa170c33df417.tar.gz chromium_src-b6c98a837a4af01daeaf36cf4beaa170c33df417.tar.bz2 |
The Cloud Print proxy now handles auth errors and disables the cloud print proxy. Also we detect loss of XMPP notifications and enter a job poll mode when we don't have notifications available.
BUG=None.
TEST=Test that the cloud print proxy disables itself when the token is invalid/expired. Also when the Talk token is invalid/expired, it should enter a job poll state.
Review URL: http://codereview.chromium.org/3374007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59257 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/cloud_print/printer_job_handler.cc')
-rw-r--r-- | chrome/service/cloud_print/printer_job_handler.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc index 36cc67e..caaffe3 100644 --- a/chrome/service/cloud_print/printer_job_handler.cc +++ b/chrome/service/cloud_print/printer_job_handler.cc @@ -10,6 +10,7 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/values.h" +#include "chrome/common/net/http_return.h" #include "chrome/service/cloud_print/cloud_print_consts.h" #include "chrome/service/cloud_print/cloud_print_helpers.h" #include "chrome/service/cloud_print/job_status_updater.h" @@ -219,6 +220,11 @@ void PrinterJobHandler::OnURLFetchComplete( const std::string& data) { LOG(INFO) << "CP_PROXY: Printer job handler, OnURLFetchComplete, url: " << url << ", response code: " << response_code; + // If there was an auth error, we are done. + if (RC_FORBIDDEN == response_code) { + OnAuthError(); + return; + } if (!shutting_down_) { DCHECK(source == request_.get()); // We need a next response handler because we are strictly a sequential @@ -249,6 +255,11 @@ bool PrinterJobHandler::OnJobCompleted(JobStatusUpdater* updater) { return ret; } +void PrinterJobHandler::OnAuthError() { + if (delegate_) + delegate_->OnAuthError(); +} + void PrinterJobHandler::OnPrinterDeleted() { printer_delete_pending_ = true; if (!task_in_progress_) { |