| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/file_manager/volume_manager_factory.h" | 5 #include "chrome/browser/chromeos/file_manager/volume_manager_factory.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 9 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 10 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 10 #include "chrome/browser/profiles/incognito_helpers.h" | 11 #include "chrome/browser/profiles/incognito_helpers.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chromeos/dbus/dbus_thread_manager.h" | 13 #include "chromeos/dbus/dbus_thread_manager.h" |
| 13 #include "chromeos/disks/disk_mount_manager.h" | 14 #include "chromeos/disks/disk_mount_manager.h" |
| 14 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 15 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 15 | 16 |
| 16 namespace file_manager { | 17 namespace file_manager { |
| 17 | 18 |
| 18 VolumeManager* VolumeManagerFactory::Get(content::BrowserContext* context) { | 19 VolumeManager* VolumeManagerFactory::Get(content::BrowserContext* context) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 35 } | 36 } |
| 36 | 37 |
| 37 bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const { | 38 bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const { |
| 38 return true; | 39 return true; |
| 39 } | 40 } |
| 40 | 41 |
| 41 BrowserContextKeyedService* VolumeManagerFactory::BuildServiceInstanceFor( | 42 BrowserContextKeyedService* VolumeManagerFactory::BuildServiceInstanceFor( |
| 42 content::BrowserContext* profile) const { | 43 content::BrowserContext* profile) const { |
| 43 VolumeManager* instance = new VolumeManager( | 44 VolumeManager* instance = new VolumeManager( |
| 44 Profile::FromBrowserContext(profile), | 45 Profile::FromBrowserContext(profile), |
| 46 drive::DriveIntegrationServiceFactory:: |
| 47 GetForProfileRegardlessOfStates(Profile::FromBrowserContext(profile)), |
| 45 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), | 48 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), |
| 46 chromeos::disks::DiskMountManager::GetInstance()); | 49 chromeos::disks::DiskMountManager::GetInstance()); |
| 47 instance->Initialize(); | 50 instance->Initialize(); |
| 48 return instance; | 51 return instance; |
| 49 } | 52 } |
| 50 | 53 |
| 51 VolumeManagerFactory::VolumeManagerFactory() | 54 VolumeManagerFactory::VolumeManagerFactory() |
| 52 : BrowserContextKeyedServiceFactory( | 55 : BrowserContextKeyedServiceFactory( |
| 53 "VolumeManagerFactory", | 56 "VolumeManagerFactory", |
| 54 BrowserContextDependencyManager::GetInstance()) { | 57 BrowserContextDependencyManager::GetInstance()) { |
| 58 DependsOn(drive::DriveIntegrationServiceFactory::GetInstance()); |
| 55 } | 59 } |
| 56 | 60 |
| 57 VolumeManagerFactory::~VolumeManagerFactory() { | 61 VolumeManagerFactory::~VolumeManagerFactory() { |
| 58 } | 62 } |
| 59 | 63 |
| 60 } // namespace file_manager | 64 } // namespace file_manager |
| OLD | NEW |