| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/google_apis/gdata_wapi_service.h" | 5 #include "chrome/browser/google_apis/gdata_wapi_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
| 12 #include "chrome/browser/google_apis/auth_service.h" | 12 #include "chrome/browser/google_apis/auth_service.h" |
| 13 #include "chrome/browser/google_apis/gdata_wapi_operations.h" | 13 #include "chrome/browser/google_apis/gdata_wapi_operations.h" |
| 14 #include "chrome/browser/google_apis/gdata_wapi_url_util.h" | 14 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" |
| 15 #include "chrome/browser/google_apis/operation_runner.h" | 15 #include "chrome/browser/google_apis/operation_runner.h" |
| 16 #include "chrome/browser/google_apis/time_util.h" | 16 #include "chrome/browser/google_apis/time_util.h" |
| 17 #include "chrome/common/net/url_util.h" | 17 #include "chrome/common/net/url_util.h" |
| 18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 19 | 19 |
| 20 using content::BrowserThread; | 20 using content::BrowserThread; |
| 21 | 21 |
| 22 namespace google_apis { | 22 namespace google_apis { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const char kDocsListScope[] = "https://docs.google.com/feeds/"; | 62 const char kDocsListScope[] = "https://docs.google.com/feeds/"; |
| 63 const char kSpreadsheetsScope[] = "https://spreadsheets.google.com/feeds/"; | 63 const char kSpreadsheetsScope[] = "https://spreadsheets.google.com/feeds/"; |
| 64 const char kUserContentScope[] = "https://docs.googleusercontent.com/"; | 64 const char kUserContentScope[] = "https://docs.googleusercontent.com/"; |
| 65 const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps"; | 65 const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps"; |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 GDataWapiService::GDataWapiService() | 69 GDataWapiService::GDataWapiService() |
| 70 : runner_(NULL), | 70 : runner_(NULL), |
| 71 // TODO(satorux): The base URL should be injected. | 71 // TODO(satorux): The base URL should be injected. |
| 72 url_generator_(GURL(gdata_wapi_url_util::kBaseUrlForProduction)) { | 72 url_generator_(GURL(GDataWapiUrlGenerator::kBaseUrlForProduction)) { |
| 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 GDataWapiService::~GDataWapiService() { | 76 GDataWapiService::~GDataWapiService() { |
| 77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 78 if (runner_.get()) { | 78 if (runner_.get()) { |
| 79 runner_->operation_registry()->RemoveObserver(this); | 79 runner_->operation_registry()->RemoveObserver(this); |
| 80 runner_->auth_service()->RemoveObserver(this); | 80 runner_->auth_service()->RemoveObserver(this); |
| 81 } | 81 } |
| 82 } | 82 } |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 DriveServiceObserver, observers_, OnProgressUpdate(list)); | 365 DriveServiceObserver, observers_, OnProgressUpdate(list)); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void GDataWapiService::OnAuthenticationFailed(GDataErrorCode error) { | 368 void GDataWapiService::OnAuthenticationFailed(GDataErrorCode error) { |
| 369 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 369 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 370 FOR_EACH_OBSERVER( | 370 FOR_EACH_OBSERVER( |
| 371 DriveServiceObserver, observers_, OnAuthenticationFailed(error)); | 371 DriveServiceObserver, observers_, OnAuthenticationFailed(error)); |
| 372 } | 372 } |
| 373 | 373 |
| 374 } // namespace google_apis | 374 } // namespace google_apis |
| OLD | NEW |