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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/provided_file_system.h

Issue 210803003: [fsp] Decouple file_service_provider::Service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
7 7
8 #include <string> 8 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h"
9 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
9 10
10 #include "base/files/file_path.h" 11 namespace extensions {
12 class EventRouter;
13 } // namespace extensions
11 14
12 namespace chromeos { 15 namespace chromeos {
13 namespace file_system_provider { 16 namespace file_system_provider {
14 17
15 // Contains information about the provided file system instance. 18 class RequestManager;
16 class ProvidedFileSystem { 19
20 // Provided file system implementation. Forwards requests between providers and
21 // clients.
22 class ProvidedFileSystem : public ProvidedFileSystemInterface {
17 public: 23 public:
18 ProvidedFileSystem(); 24 ProvidedFileSystem(extensions::EventRouter* event_router,
19 ProvidedFileSystem(const std::string& extension_id, 25 RequestManager* request_manager,
20 int file_system_id, 26 const ProvidedFileSystemInfo& file_system_info);
21 const std::string& file_system_name, 27 virtual ~ProvidedFileSystem();
22 const base::FilePath& mount_path);
23 28
24 ~ProvidedFileSystem(); 29 // ProvidedFileSystemInterface overrides.
25 30 virtual bool RequestUnmount(
26 const std::string& extension_id() const { return extension_id_; } 31 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
27 int file_system_id() const { return file_system_id_; } 32 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE;
28 const std::string& file_system_name() const { return file_system_name_; }
29 const base::FilePath& mount_path() const { return mount_path_; }
30 33
31 private: 34 private:
32 // ID of the extension providing this file system. 35 extensions::EventRouter* event_router_;
33 std::string extension_id_; 36 RequestManager* request_manager_;
37 ProvidedFileSystemInfo file_system_info_;
34 38
35 // ID of the file system, used internally. 39 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem);
36 int file_system_id_; 40 };
37 41
38 // Name of the file system, can be rendered in the UI. 42 // Factory creating provided file system instances.
39 std::string file_system_name_; 43 class ProvidedFileSystemFactory : public ProvidedFileSystemFactoryInterface {
hashimoto 2014/04/15 13:42:00 This class is unneeded?
mtomasz 2014/04/16 01:04:04 Done.
44 public:
45 ProvidedFileSystemFactory();
40 46
41 // Mount path of the underlying file system. 47 // ProvidedFileSystemFactoryInterface overrides.
42 base::FilePath mount_path_; 48 virtual ProvidedFileSystemInterface* Create(
49 EventRouter* event_router,
50 RequestManager* request_manager,
51 const ProvidedFileSystemInfo& file_system_info) OVERRIDE;
52
53 private:
54 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystemFactory);
43 }; 55 };
44 56
45 } // namespace file_system_provider 57 } // namespace file_system_provider
46 } // namespace chromeos 58 } // namespace chromeos
47 59
48 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ 60 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698