| 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..a57bcc2b772e65c6fb10c8d874b17a261474303d 100644
|
| --- a/chrome/browser/chromeos/drive/drive_integration_service.cc
|
| +++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
|
| @@ -540,6 +540,9 @@ void DriveIntegrationService::AvoidDriveAsDownloadDirecotryPreference() {
|
|
|
| //===================== DriveIntegrationServiceFactory =======================
|
|
|
| +DriveIntegrationServiceFactory::FactoryCallback*
|
| + DriveIntegrationServiceFactory::factory_for_test_ = NULL;
|
| +
|
| // static
|
| DriveIntegrationService* DriveIntegrationServiceFactory::GetForProfile(
|
| Profile* profile) {
|
| @@ -575,8 +578,8 @@ DriveIntegrationServiceFactory* DriveIntegrationServiceFactory::GetInstance() {
|
|
|
| // static
|
| void DriveIntegrationServiceFactory::SetFactoryForTest(
|
| - const FactoryCallback& factory_for_test) {
|
| - GetInstance()->factory_for_test_ = factory_for_test;
|
| + FactoryCallback* factory_for_test) {
|
| + factory_for_test_ = factory_for_test;
|
| }
|
|
|
| DriveIntegrationServiceFactory::DriveIntegrationServiceFactory()
|
| @@ -597,7 +600,7 @@ DriveIntegrationServiceFactory::BuildServiceInstanceFor(
|
| Profile* profile = Profile::FromBrowserContext(context);
|
|
|
| DriveIntegrationService* service = NULL;
|
| - if (factory_for_test_.is_null()) {
|
| + if (!factory_for_test_) {
|
| DriveIntegrationService::PreferenceWatcher* preference_watcher = NULL;
|
| if (chromeos::IsProfileAssociatedWithGaiaAccount(profile)) {
|
| // Drive File System can be enabled.
|
| @@ -608,7 +611,7 @@ DriveIntegrationServiceFactory::BuildServiceInstanceFor(
|
| service = new DriveIntegrationService(profile, preference_watcher,
|
| NULL, base::FilePath(), NULL);
|
| } else {
|
| - service = factory_for_test_.Run(profile);
|
| + service = factory_for_test_->Run(profile);
|
| }
|
|
|
| return service;
|
|
|