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 "components/drive/service/drive_api_service.h" | 5 #include "components/drive/service/drive_api_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 DriveAPIService::DriveAPIService( | 251 DriveAPIService::DriveAPIService( |
252 OAuth2TokenService* oauth2_token_service, | 252 OAuth2TokenService* oauth2_token_service, |
253 net::URLRequestContextGetter* url_request_context_getter, | 253 net::URLRequestContextGetter* url_request_context_getter, |
254 base::SequencedTaskRunner* blocking_task_runner, | 254 base::SequencedTaskRunner* blocking_task_runner, |
255 const GURL& base_url, | 255 const GURL& base_url, |
256 const GURL& base_thumbnail_url, | 256 const GURL& base_thumbnail_url, |
257 const std::string& custom_user_agent) | 257 const std::string& custom_user_agent) |
258 : oauth2_token_service_(oauth2_token_service), | 258 : oauth2_token_service_(oauth2_token_service), |
259 url_request_context_getter_(url_request_context_getter), | 259 url_request_context_getter_(url_request_context_getter), |
260 blocking_task_runner_(blocking_task_runner), | 260 blocking_task_runner_(blocking_task_runner), |
261 url_generator_(base_url, base_thumbnail_url), | 261 url_generator_(base_url, base_thumbnail_url, |
| 262 google_apis::GetTeamDrivesIntegrationSwitch()), |
262 custom_user_agent_(custom_user_agent) { | 263 custom_user_agent_(custom_user_agent) { |
263 } | 264 } |
264 | 265 |
265 DriveAPIService::~DriveAPIService() { | 266 DriveAPIService::~DriveAPIService() { |
266 DCHECK(thread_checker_.CalledOnValidThread()); | 267 DCHECK(thread_checker_.CalledOnValidThread()); |
267 if (sender_.get()) | 268 if (sender_.get()) |
268 sender_->auth_service()->RemoveObserver(this); | 269 sender_->auth_service()->RemoveObserver(this); |
269 } | 270 } |
270 | 271 |
271 void DriveAPIService::Initialize(const std::string& account_id) { | 272 void DriveAPIService::Initialize(const std::string& account_id) { |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 // RequestSender before the request is committed because the request has a | 878 // RequestSender before the request is committed because the request has a |
878 // reference to RequestSender and we should ensure to delete the request when | 879 // reference to RequestSender and we should ensure to delete the request when |
879 // the sender is deleted. Resolve the circulating dependency and fix it. | 880 // the sender is deleted. Resolve the circulating dependency and fix it. |
880 const google_apis::CancelCallback callback = | 881 const google_apis::CancelCallback callback = |
881 sender_->StartRequestWithAuthRetry(std::move(request)); | 882 sender_->StartRequestWithAuthRetry(std::move(request)); |
882 return base::MakeUnique<BatchRequestConfigurator>( | 883 return base::MakeUnique<BatchRequestConfigurator>( |
883 weak_ref, sender_->blocking_task_runner(), url_generator_, callback); | 884 weak_ref, sender_->blocking_task_runner(), url_generator_, callback); |
884 } | 885 } |
885 | 886 |
886 } // namespace drive | 887 } // namespace drive |
OLD | NEW |