| Index: chrome/browser/chromeos/drive/drive_integration_service.cc
|
| diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc
|
| index 08c9fc5f1dbb0ce7094fb1e13f5413ff7544cc06..d0e9c05cdc615147db140991ec6032db1105fa08 100644
|
| --- a/chrome/browser/chromeos/drive/drive_integration_service.cc
|
| +++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
|
| @@ -540,6 +540,10 @@ void DriveIntegrationService::AvoidDriveAsDownloadDirecotryPreference() {
|
|
|
| //===================== DriveIntegrationServiceFactory =======================
|
|
|
| +DriveIntegrationServiceFactory::FactoryFunction*
|
| + DriveIntegrationServiceFactory::factory_function_for_test_ = NULL;
|
| +void* DriveIntegrationServiceFactory::factory_data_for_test_ = NULL;
|
| +
|
| // static
|
| DriveIntegrationService* DriveIntegrationServiceFactory::GetForProfile(
|
| Profile* profile) {
|
| @@ -575,8 +579,9 @@ DriveIntegrationServiceFactory* DriveIntegrationServiceFactory::GetInstance() {
|
|
|
| // static
|
| void DriveIntegrationServiceFactory::SetFactoryForTest(
|
| - const FactoryCallback& factory_for_test) {
|
| - GetInstance()->factory_for_test_ = factory_for_test;
|
| + FactoryFunction* factory_for_test, void* data) {
|
| + factory_function_for_test_ = factory_for_test;
|
| + factory_data_for_test_ = data;
|
| }
|
|
|
| DriveIntegrationServiceFactory::DriveIntegrationServiceFactory()
|
| @@ -597,7 +602,7 @@ DriveIntegrationServiceFactory::BuildServiceInstanceFor(
|
| Profile* profile = Profile::FromBrowserContext(context);
|
|
|
| DriveIntegrationService* service = NULL;
|
| - if (factory_for_test_.is_null()) {
|
| + if (!factory_function_for_test_) {
|
| DriveIntegrationService::PreferenceWatcher* preference_watcher = NULL;
|
| if (chromeos::IsProfileAssociatedWithGaiaAccount(profile)) {
|
| // Drive File System can be enabled.
|
| @@ -608,7 +613,7 @@ DriveIntegrationServiceFactory::BuildServiceInstanceFor(
|
| service = new DriveIntegrationService(profile, preference_watcher,
|
| NULL, base::FilePath(), NULL);
|
| } else {
|
| - service = factory_for_test_.Run(profile);
|
| + service = factory_function_for_test_(profile, factory_data_for_test_);
|
| }
|
|
|
| return service;
|
|
|