Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/volume_manager_factory.cc

Issue 23890002: Extract OnDiskEvent and OnFormatEvent logic part from EventRouter to VolumeManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extensions/file_manager/volume_manager_factory .h" 5 #include "chrome/browser/chromeos/extensions/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/extensions/file_manager/volume_manager.h" 9 #include "chrome/browser/chromeos/extensions/file_manager/volume_manager.h"
10 #include "chrome/browser/profiles/incognito_helpers.h" 10 #include "chrome/browser/profiles/incognito_helpers.h"
11 #include "chrome/browser/profiles/profile.h"
11 #include "chromeos/disks/disk_mount_manager.h" 12 #include "chromeos/disks/disk_mount_manager.h"
12 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 13 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
13 14
14 namespace file_manager { 15 namespace file_manager {
15 16
16 VolumeManager* VolumeManagerFactory::Get(content::BrowserContext* context) { 17 VolumeManager* VolumeManagerFactory::Get(content::BrowserContext* context) {
17 return static_cast<VolumeManager*>( 18 return static_cast<VolumeManager*>(
18 GetInstance()->GetServiceForBrowserContext(context, true)); 19 GetInstance()->GetServiceForBrowserContext(context, true));
19 } 20 }
20 21
(...skipping 11 matching lines...) Expand all
32 return true; 33 return true;
33 } 34 }
34 35
35 bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const { 36 bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const {
36 return true; 37 return true;
37 } 38 }
38 39
39 BrowserContextKeyedService* VolumeManagerFactory::BuildServiceInstanceFor( 40 BrowserContextKeyedService* VolumeManagerFactory::BuildServiceInstanceFor(
40 content::BrowserContext* profile) const { 41 content::BrowserContext* profile) const {
41 VolumeManager* instance = 42 VolumeManager* instance =
42 new VolumeManager(chromeos::disks::DiskMountManager::GetInstance()); 43 new VolumeManager(Profile::FromBrowserContext(profile),
44 chromeos::disks::DiskMountManager::GetInstance());
43 instance->Initialize(); 45 instance->Initialize();
44 return instance; 46 return instance;
45 } 47 }
46 48
47 VolumeManagerFactory::VolumeManagerFactory() 49 VolumeManagerFactory::VolumeManagerFactory()
48 : BrowserContextKeyedServiceFactory( 50 : BrowserContextKeyedServiceFactory(
49 "VolumeManagerFactory", 51 "VolumeManagerFactory",
50 BrowserContextDependencyManager::GetInstance()) { 52 BrowserContextDependencyManager::GetInstance()) {
51 } 53 }
52 54
53 VolumeManagerFactory::~VolumeManagerFactory() { 55 VolumeManagerFactory::~VolumeManagerFactory() {
54 } 56 }
55 57
56 } // namespace file_manager 58 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698