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/drive/drive_integration_service.h" |
10 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 10 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 11 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" |
11 #include "chrome/browser/profiles/incognito_helpers.h" | 12 #include "chrome/browser/profiles/incognito_helpers.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chromeos/dbus/dbus_thread_manager.h" | 14 #include "chromeos/dbus/dbus_thread_manager.h" |
14 #include "chromeos/disks/disk_mount_manager.h" | 15 #include "chromeos/disks/disk_mount_manager.h" |
15 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 16 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
16 | 17 |
17 namespace file_manager { | 18 namespace file_manager { |
18 | 19 |
19 VolumeManager* VolumeManagerFactory::Get(content::BrowserContext* context) { | 20 VolumeManager* VolumeManagerFactory::Get(content::BrowserContext* context) { |
20 return static_cast<VolumeManager*>( | 21 return static_cast<VolumeManager*>( |
(...skipping 15 matching lines...) Expand all Loading... |
36 } | 37 } |
37 | 38 |
38 bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const { | 39 bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const { |
39 return true; | 40 return true; |
40 } | 41 } |
41 | 42 |
42 KeyedService* VolumeManagerFactory::BuildServiceInstanceFor( | 43 KeyedService* VolumeManagerFactory::BuildServiceInstanceFor( |
43 content::BrowserContext* profile) const { | 44 content::BrowserContext* profile) const { |
44 VolumeManager* instance = new VolumeManager( | 45 VolumeManager* instance = new VolumeManager( |
45 Profile::FromBrowserContext(profile), | 46 Profile::FromBrowserContext(profile), |
46 drive::DriveIntegrationServiceFactory:: | 47 drive::DriveIntegrationServiceFactory::GetForProfileRegardlessOfStates( |
47 GetForProfileRegardlessOfStates(Profile::FromBrowserContext(profile)), | 48 Profile::FromBrowserContext(profile)), |
48 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), | 49 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), |
49 chromeos::disks::DiskMountManager::GetInstance()); | 50 chromeos::disks::DiskMountManager::GetInstance(), |
| 51 chromeos::file_system_provider::ServiceFactory::Get( |
| 52 Profile::FromBrowserContext(profile))); |
50 instance->Initialize(); | 53 instance->Initialize(); |
51 return instance; | 54 return instance; |
52 } | 55 } |
53 | 56 |
54 VolumeManagerFactory::VolumeManagerFactory() | 57 VolumeManagerFactory::VolumeManagerFactory() |
55 : BrowserContextKeyedServiceFactory( | 58 : BrowserContextKeyedServiceFactory( |
56 "VolumeManagerFactory", | 59 "VolumeManagerFactory", |
57 BrowserContextDependencyManager::GetInstance()) { | 60 BrowserContextDependencyManager::GetInstance()) { |
58 DependsOn(drive::DriveIntegrationServiceFactory::GetInstance()); | 61 DependsOn(drive::DriveIntegrationServiceFactory::GetInstance()); |
| 62 DependsOn(chromeos::file_system_provider::ServiceFactory::GetInstance()); |
59 } | 63 } |
60 | 64 |
61 VolumeManagerFactory::~VolumeManagerFactory() { | 65 VolumeManagerFactory::~VolumeManagerFactory() { |
62 } | 66 } |
63 | 67 |
64 } // namespace file_manager | 68 } // namespace file_manager |
OLD | NEW |