Chromium Code Reviews| 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/drive/gdata_wapi_service.h" | 5 #include "chrome/browser/drive/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/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/drive/drive_api_util.h" | 13 #include "chrome/browser/drive/drive_api_util.h" |
| 14 #include "chrome/browser/google_apis/auth_service.h" | 14 #include "chrome/browser/google_apis/auth_service.h" |
| 15 #include "chrome/browser/google_apis/drive_api_parser.h" | 15 #include "chrome/browser/google_apis/drive_api_parser.h" |
| 16 #include "chrome/browser/google_apis/gdata_errorcode.h" | 16 #include "chrome/browser/google_apis/gdata_errorcode.h" |
| 17 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 17 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
| 18 #include "chrome/browser/google_apis/gdata_wapi_requests.h" | 18 #include "chrome/browser/google_apis/gdata_wapi_requests.h" |
| 19 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" | 19 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" |
| 20 #include "chrome/browser/google_apis/request_sender.h" | 20 #include "chrome/browser/google_apis/request_sender.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "net/url_request/url_request_context_getter.h" | 22 #include "net/url_request/url_request_context_getter.h" |
|
mmenke
2013/11/07 17:02:36
Don't we need sequenced_task_runner here, to incre
hashimoto
2013/11/08 04:08:17
browser_thread.h includes it.
Anyways, added expli
| |
| 23 | 23 |
| 24 using content::BrowserThread; | 24 using content::BrowserThread; |
| 25 using google_apis::AboutResource; | 25 using google_apis::AboutResource; |
| 26 using google_apis::AboutResourceCallback; | 26 using google_apis::AboutResourceCallback; |
| 27 using google_apis::AccountMetadata; | 27 using google_apis::AccountMetadata; |
| 28 using google_apis::AddResourceToDirectoryRequest; | 28 using google_apis::AddResourceToDirectoryRequest; |
| 29 using google_apis::AppList; | 29 using google_apis::AppList; |
| 30 using google_apis::AppListCallback; | 30 using google_apis::AppListCallback; |
| 31 using google_apis::AuthService; | 31 using google_apis::AuthService; |
| 32 using google_apis::AuthStatusCallback; | 32 using google_apis::AuthStatusCallback; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 app_list = util::ConvertAccountMetadataToAppList(*account_metadata); | 121 app_list = util::ConvertAccountMetadataToAppList(*account_metadata); |
| 122 | 122 |
| 123 callback.Run(error, app_list.Pass()); | 123 callback.Run(error, app_list.Pass()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace | 126 } // namespace |
| 127 | 127 |
| 128 GDataWapiService::GDataWapiService( | 128 GDataWapiService::GDataWapiService( |
| 129 OAuth2TokenService* oauth2_token_service, | 129 OAuth2TokenService* oauth2_token_service, |
| 130 net::URLRequestContextGetter* url_request_context_getter, | 130 net::URLRequestContextGetter* url_request_context_getter, |
| 131 base::TaskRunner* blocking_task_runner, | 131 base::SequencedTaskRunner* blocking_task_runner, |
| 132 const GURL& base_url, | 132 const GURL& base_url, |
| 133 const GURL& base_download_url, | 133 const GURL& base_download_url, |
| 134 const std::string& custom_user_agent) | 134 const std::string& custom_user_agent) |
| 135 : oauth2_token_service_(oauth2_token_service), | 135 : oauth2_token_service_(oauth2_token_service), |
| 136 url_request_context_getter_(url_request_context_getter), | 136 url_request_context_getter_(url_request_context_getter), |
| 137 blocking_task_runner_(blocking_task_runner), | 137 blocking_task_runner_(blocking_task_runner), |
| 138 url_generator_(base_url, base_download_url), | 138 url_generator_(base_url, base_download_url), |
| 139 custom_user_agent_(custom_user_agent) { | 139 custom_user_agent_(custom_user_agent) { |
| 140 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 140 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 141 } | 141 } |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 669 if (CanSendRequest()) { | 669 if (CanSendRequest()) { |
| 670 FOR_EACH_OBSERVER( | 670 FOR_EACH_OBSERVER( |
| 671 DriveServiceObserver, observers_, OnReadyToSendRequests()); | 671 DriveServiceObserver, observers_, OnReadyToSendRequests()); |
| 672 } else if (!HasRefreshToken()) { | 672 } else if (!HasRefreshToken()) { |
| 673 FOR_EACH_OBSERVER( | 673 FOR_EACH_OBSERVER( |
| 674 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); | 674 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); |
| 675 } | 675 } |
| 676 } | 676 } |
| 677 | 677 |
| 678 } // namespace drive | 678 } // namespace drive |
| OLD | NEW |