summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/gdata
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/gdata')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_operation_registry.cc12
-rw-r--r--chrome/browser/chromeos/gdata/gdata_operation_registry.h5
-rw-r--r--chrome/browser/chromeos/gdata/gdata_operations.cc3
3 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_operation_registry.cc b/chrome/browser/chromeos/gdata/gdata_operation_registry.cc
index b99a78e..683275d 100644
--- a/chrome/browser/chromeos/gdata/gdata_operation_registry.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operation_registry.cc
@@ -128,6 +128,11 @@ void GDataOperationRegistry::Operation::NotifyResume() {
}
}
+void GDataOperationRegistry::Operation::NotifyAuthFailed() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ registry_->OnOperationAuthFailed();
+}
+
GDataOperationRegistry::GDataOperationRegistry() {
in_flight_operations_.set_check_on_null_data(true);
}
@@ -266,6 +271,13 @@ void GDataOperationRegistry::OnOperationSuspend(OperationID id) {
}
}
+void GDataOperationRegistry::OnOperationAuthFailed() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ DVLOG(1) << "GDataOperation authentication failed.";
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnAuthenticationFailed());
+}
+
bool GDataOperationRegistry::IsFileTransferOperation(
const Operation* operation) const {
OperationType type = operation->progress_status().operation_type;
diff --git a/chrome/browser/chromeos/gdata/gdata_operation_registry.h b/chrome/browser/chromeos/gdata/gdata_operation_registry.h
index 95dc2a3..a195681 100644
--- a/chrome/browser/chromeos/gdata/gdata_operation_registry.h
+++ b/chrome/browser/chromeos/gdata/gdata_operation_registry.h
@@ -76,6 +76,8 @@ class GDataOperationRegistry {
public:
// Called when a GData operation started, made some progress, or finished.
virtual void OnProgressUpdate(const ProgressStatusList& list) = 0;
+ // Called when GData authentication failed.
+ virtual void OnAuthenticationFailed() {}
protected:
virtual ~Observer() {}
};
@@ -112,6 +114,8 @@ class GDataOperationRegistry {
// that it removes the existing "suspend" operation.
void NotifySuspend();
void NotifyResume();
+ // Notifies that authentication has failed.
+ void NotifyAuthFailed();
private:
// Does the cancellation.
@@ -144,6 +148,7 @@ class GDataOperationRegistry {
void OnOperationFinish(OperationID operation);
void OnOperationSuspend(OperationID operation);
void OnOperationResume(Operation* operation, ProgressStatus* new_status);
+ void OnOperationAuthFailed();
bool IsFileTransferOperation(const Operation* operation) const;
diff --git a/chrome/browser/chromeos/gdata/gdata_operations.cc b/chrome/browser/chromeos/gdata/gdata_operations.cc
index be08bd5..ad6df46 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
@@ -349,6 +349,9 @@ void UrlFetchOperationBase::OnAuthFailed(GDataErrorCode code) {
NotifyStart();
NotifyFinish(GDataOperationRegistry::OPERATION_FAILED);
+
+ // Notify authentication failed.
+ NotifyAuthFailed();
}
std::string UrlFetchOperationBase::GetResponseHeadersAsString(