| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/drive/drive_service_bridge.h" | 5 #include "chrome/browser/apps/drive/drive_service_bridge.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 worker_pool->GetSequenceToken(), | 77 worker_pool->GetSequenceToken(), |
| 78 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 78 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 79 | 79 |
| 80 ProfileOAuth2TokenService* token_service = | 80 ProfileOAuth2TokenService* token_service = |
| 81 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 81 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
| 82 drive_service_.reset(new drive::DriveAPIService( | 82 drive_service_.reset(new drive::DriveAPIService( |
| 83 token_service, | 83 token_service, |
| 84 profile_->GetRequestContext(), | 84 profile_->GetRequestContext(), |
| 85 drive_task_runner.get(), | 85 drive_task_runner.get(), |
| 86 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), | 86 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), |
| 87 GURL(google_apis::DriveApiUrlGenerator::kBaseDownloadUrlForProduction), | |
| 88 GURL(google_apis::DriveApiUrlGenerator::kBaseThumbnailUrlForProduction), | 87 GURL(google_apis::DriveApiUrlGenerator::kBaseThumbnailUrlForProduction), |
| 89 std::string() /* custom_user_agent */)); | 88 std::string() /* custom_user_agent */)); |
| 90 SigninManagerBase* signin_manager = | 89 SigninManagerBase* signin_manager = |
| 91 SigninManagerFactory::GetForProfile(profile_); | 90 SigninManagerFactory::GetForProfile(profile_); |
| 92 drive_service_->Initialize(signin_manager->GetAuthenticatedAccountId()); | 91 drive_service_->Initialize(signin_manager->GetAuthenticatedAccountId()); |
| 93 drive_service_->AddObserver(this); | 92 drive_service_->AddObserver(this); |
| 94 | 93 |
| 95 drive::DriveNotificationManager* drive_notification_manager = | 94 drive::DriveNotificationManager* drive_notification_manager = |
| 96 drive::DriveNotificationManagerFactory::GetForBrowserContext(profile_); | 95 drive::DriveNotificationManagerFactory::GetForBrowserContext(profile_); |
| 97 if (drive_notification_manager) | 96 if (drive_notification_manager) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 131 } |
| 133 | 132 |
| 134 // static | 133 // static |
| 135 void DriveServiceBridge::AppendDependsOnFactories( | 134 void DriveServiceBridge::AppendDependsOnFactories( |
| 136 std::set<BrowserContextKeyedServiceFactory*>* factories) { | 135 std::set<BrowserContextKeyedServiceFactory*>* factories) { |
| 137 DCHECK(factories); | 136 DCHECK(factories); |
| 138 factories->insert(ProfileOAuth2TokenServiceFactory::GetInstance()); | 137 factories->insert(ProfileOAuth2TokenServiceFactory::GetInstance()); |
| 139 factories->insert(SigninManagerFactory::GetInstance()); | 138 factories->insert(SigninManagerFactory::GetInstance()); |
| 140 factories->insert(drive::DriveNotificationManagerFactory::GetInstance()); | 139 factories->insert(drive::DriveNotificationManagerFactory::GetInstance()); |
| 141 } | 140 } |
| OLD | NEW |