| 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/sequenced_task_runner.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 #include "chrome/browser/drive/drive_api_util.h" | 14 #include "chrome/browser/drive/drive_api_util.h" |
| 14 #include "chrome/browser/google_apis/auth_service.h" | 15 #include "chrome/browser/google_apis/auth_service.h" |
| 15 #include "chrome/browser/google_apis/drive_api_parser.h" | 16 #include "chrome/browser/google_apis/drive_api_parser.h" |
| 16 #include "chrome/browser/google_apis/gdata_errorcode.h" | 17 #include "chrome/browser/google_apis/gdata_errorcode.h" |
| 17 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 18 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
| 18 #include "chrome/browser/google_apis/gdata_wapi_requests.h" | 19 #include "chrome/browser/google_apis/gdata_wapi_requests.h" |
| 19 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" | 20 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" |
| 20 #include "chrome/browser/google_apis/request_sender.h" | 21 #include "chrome/browser/google_apis/request_sender.h" |
| 21 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 app_list = util::ConvertAccountMetadataToAppList(*account_metadata); | 122 app_list = util::ConvertAccountMetadataToAppList(*account_metadata); |
| 122 | 123 |
| 123 callback.Run(error, app_list.Pass()); | 124 callback.Run(error, app_list.Pass()); |
| 124 } | 125 } |
| 125 | 126 |
| 126 } // namespace | 127 } // namespace |
| 127 | 128 |
| 128 GDataWapiService::GDataWapiService( | 129 GDataWapiService::GDataWapiService( |
| 129 OAuth2TokenService* oauth2_token_service, | 130 OAuth2TokenService* oauth2_token_service, |
| 130 net::URLRequestContextGetter* url_request_context_getter, | 131 net::URLRequestContextGetter* url_request_context_getter, |
| 131 base::TaskRunner* blocking_task_runner, | 132 base::SequencedTaskRunner* blocking_task_runner, |
| 132 const GURL& base_url, | 133 const GURL& base_url, |
| 133 const GURL& base_download_url, | 134 const GURL& base_download_url, |
| 134 const std::string& custom_user_agent) | 135 const std::string& custom_user_agent) |
| 135 : oauth2_token_service_(oauth2_token_service), | 136 : oauth2_token_service_(oauth2_token_service), |
| 136 url_request_context_getter_(url_request_context_getter), | 137 url_request_context_getter_(url_request_context_getter), |
| 137 blocking_task_runner_(blocking_task_runner), | 138 blocking_task_runner_(blocking_task_runner), |
| 138 url_generator_(base_url, base_download_url), | 139 url_generator_(base_url, base_download_url), |
| 139 custom_user_agent_(custom_user_agent) { | 140 custom_user_agent_(custom_user_agent) { |
| 140 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 141 } | 142 } |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 if (CanSendRequest()) { | 670 if (CanSendRequest()) { |
| 670 FOR_EACH_OBSERVER( | 671 FOR_EACH_OBSERVER( |
| 671 DriveServiceObserver, observers_, OnReadyToSendRequests()); | 672 DriveServiceObserver, observers_, OnReadyToSendRequests()); |
| 672 } else if (!HasRefreshToken()) { | 673 } else if (!HasRefreshToken()) { |
| 673 FOR_EACH_OBSERVER( | 674 FOR_EACH_OBSERVER( |
| 674 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); | 675 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); |
| 675 } | 676 } |
| 676 } | 677 } |
| 677 | 678 |
| 678 } // namespace drive | 679 } // namespace drive |
| OLD | NEW |