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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/volume_manager.h

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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_VOLUME_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_VOLUME_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_VOLUME_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_VOLUME_MANAGER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
11 #include "chromeos/disks/disk_mount_manager.h" 11 #include "chromeos/disks/disk_mount_manager.h"
12 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" 12 #include "components/browser_context_keyed_service/browser_context_keyed_service .h"
13 13
14 class Profile;
15
14 namespace content { 16 namespace content {
15 class BrowserContext; 17 class BrowserContext;
16 } // namespace content 18 } // namespace content
17 19
18 namespace file_manager { 20 namespace file_manager {
19 21
20 class VolumeManagerObserver; 22 class VolumeManagerObserver;
21 23
22 // This manager manages "Drive" and "Downloads" in addition to disks managed 24 // This manager manages "Drive" and "Downloads" in addition to disks managed
23 // by DiskMountManager. 25 // by DiskMountManager.
(...skipping 26 matching lines...) Expand all
50 52
51 // Manages "Volume"s for file manager. Here are "Volume"s. 53 // Manages "Volume"s for file manager. Here are "Volume"s.
52 // - Drive File System (not yet supported). 54 // - Drive File System (not yet supported).
53 // - Downloads directory. 55 // - Downloads directory.
54 // - Removable disks (volume will be created for each partition, not only one 56 // - Removable disks (volume will be created for each partition, not only one
55 // for a device). 57 // for a device).
56 // - Mounted zip archives. 58 // - Mounted zip archives.
57 class VolumeManager : public BrowserContextKeyedService, 59 class VolumeManager : public BrowserContextKeyedService,
58 public chromeos::disks::DiskMountManager::Observer { 60 public chromeos::disks::DiskMountManager::Observer {
59 public: 61 public:
60 explicit VolumeManager( 62 VolumeManager(Profile* profile,
61 chromeos::disks::DiskMountManager* disk_mount_manager); 63 chromeos::disks::DiskMountManager* disk_mount_manager);
62 virtual ~VolumeManager(); 64 virtual ~VolumeManager();
63 65
64 // Returns the instance corresponding to the |context|. 66 // Returns the instance corresponding to the |context|.
65 static VolumeManager* Get(content::BrowserContext* context); 67 static VolumeManager* Get(content::BrowserContext* context);
66 68
67 // Intializes this instance. 69 // Intializes this instance.
68 void Initialize(); 70 void Initialize();
69 71
70 // Disposes this instance. 72 // Disposes this instance.
71 virtual void Shutdown() OVERRIDE; 73 virtual void Shutdown() OVERRIDE;
(...skipping 19 matching lines...) Expand all
91 chromeos::disks::DiskMountManager::MountEvent event, 93 chromeos::disks::DiskMountManager::MountEvent event,
92 chromeos::MountError error_code, 94 chromeos::MountError error_code,
93 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) 95 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info)
94 OVERRIDE; 96 OVERRIDE;
95 virtual void OnFormatEvent( 97 virtual void OnFormatEvent(
96 chromeos::disks::DiskMountManager::FormatEvent event, 98 chromeos::disks::DiskMountManager::FormatEvent event,
97 chromeos::FormatError error_code, 99 chromeos::FormatError error_code,
98 const std::string& device_path) OVERRIDE; 100 const std::string& device_path) OVERRIDE;
99 101
100 private: 102 private:
103 Profile* profile_;
104 chromeos::disks::DiskMountManager* disk_mount_manager_;
101 ObserverList<VolumeManagerObserver> observers_; 105 ObserverList<VolumeManagerObserver> observers_;
102 chromeos::disks::DiskMountManager* disk_mount_manager_;
103 DISALLOW_COPY_AND_ASSIGN(VolumeManager); 106 DISALLOW_COPY_AND_ASSIGN(VolumeManager);
104 }; 107 };
105 108
106 } // namespace file_manager 109 } // namespace file_manager
107 110
108 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_VOLUME_MANAGER_H_ 111 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_VOLUME_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698