| 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 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/drive/drive_api_service.h" | 10 #include "chrome/browser/drive/drive_api_service.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 76 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 77 | 77 |
| 78 ProfileOAuth2TokenService* token_service = | 78 ProfileOAuth2TokenService* token_service = |
| 79 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 79 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
| 80 drive_service_.reset(new drive::DriveAPIService( | 80 drive_service_.reset(new drive::DriveAPIService( |
| 81 token_service, | 81 token_service, |
| 82 profile_->GetRequestContext(), | 82 profile_->GetRequestContext(), |
| 83 drive_task_runner.get(), | 83 drive_task_runner.get(), |
| 84 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), | 84 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), |
| 85 GURL(google_apis::DriveApiUrlGenerator::kBaseDownloadUrlForProduction), | 85 GURL(google_apis::DriveApiUrlGenerator::kBaseDownloadUrlForProduction), |
| 86 GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction), | |
| 87 std::string() /* custom_user_agent */)); | 86 std::string() /* custom_user_agent */)); |
| 88 SigninManagerBase* signin_manager = | 87 SigninManagerBase* signin_manager = |
| 89 SigninManagerFactory::GetForProfile(profile_); | 88 SigninManagerFactory::GetForProfile(profile_); |
| 90 drive_service_->Initialize(signin_manager->GetAuthenticatedAccountId()); | 89 drive_service_->Initialize(signin_manager->GetAuthenticatedAccountId()); |
| 91 drive_service_->AddObserver(this); | 90 drive_service_->AddObserver(this); |
| 92 | 91 |
| 93 drive::DriveNotificationManager* drive_notification_manager = | 92 drive::DriveNotificationManager* drive_notification_manager = |
| 94 drive::DriveNotificationManagerFactory::GetForBrowserContext(profile_); | 93 drive::DriveNotificationManagerFactory::GetForBrowserContext(profile_); |
| 95 if (drive_notification_manager) | 94 if (drive_notification_manager) |
| 96 drive_notification_manager->AddObserver(this); | 95 drive_notification_manager->AddObserver(this); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 128 } |
| 130 | 129 |
| 131 // static | 130 // static |
| 132 void DriveServiceBridge::AppendDependsOnFactories( | 131 void DriveServiceBridge::AppendDependsOnFactories( |
| 133 std::set<BrowserContextKeyedServiceFactory*>* factories) { | 132 std::set<BrowserContextKeyedServiceFactory*>* factories) { |
| 134 DCHECK(factories); | 133 DCHECK(factories); |
| 135 factories->insert(ProfileOAuth2TokenServiceFactory::GetInstance()); | 134 factories->insert(ProfileOAuth2TokenServiceFactory::GetInstance()); |
| 136 factories->insert(SigninManagerFactory::GetInstance()); | 135 factories->insert(SigninManagerFactory::GetInstance()); |
| 137 factories->insert(drive::DriveNotificationManagerFactory::GetInstance()); | 136 factories->insert(drive::DriveNotificationManagerFactory::GetInstance()); |
| 138 } | 137 } |
| OLD | NEW |