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

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

Issue 258783006: [fsp] Add the getMetadata operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed a lot. Created 6 years, 7 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 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" 5 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "chrome/browser/chromeos/file_system_provider/operations/get_metadata.h "
8 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h" 9 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h"
9 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" 10 #include "chrome/browser/chromeos/file_system_provider/request_manager.h"
10 #include "chrome/common/extensions/api/file_system_provider.h" 11 #include "chrome/common/extensions/api/file_system_provider.h"
11 #include "extensions/browser/event_router.h" 12 #include "extensions/browser/event_router.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 namespace file_system_provider { 15 namespace file_system_provider {
15 namespace { 16 namespace {
16 17
17 } // namespace 18 } // namespace
18 19
19 ProvidedFileSystem::ProvidedFileSystem( 20 ProvidedFileSystem::ProvidedFileSystem(
20 extensions::EventRouter* event_router, 21 extensions::EventRouter* event_router,
21 const ProvidedFileSystemInfo& file_system_info) 22 const ProvidedFileSystemInfo& file_system_info)
22 : event_router_(event_router), file_system_info_(file_system_info) { 23 : event_router_(event_router), file_system_info_(file_system_info) {
23 } 24 }
24 25
25 ProvidedFileSystem::~ProvidedFileSystem() {} 26 ProvidedFileSystem::~ProvidedFileSystem() {}
26 27
27 void ProvidedFileSystem::RequestUnmount( 28 void ProvidedFileSystem::RequestUnmount(
28 const fileapi::AsyncFileUtil::StatusCallback& callback) { 29 const fileapi::AsyncFileUtil::StatusCallback& callback) {
29 if (!request_manager_.CreateRequest( 30 if (!request_manager_.CreateRequest(
30 make_scoped_ptr<RequestManager::HandlerInterface>( 31 make_scoped_ptr<RequestManager::HandlerInterface>(
31 new operations::Unmount( 32 new operations::Unmount(
32 event_router_, file_system_info_, callback)))) { 33 event_router_, file_system_info_, callback)))) {
33 callback.Run(base::File::FILE_ERROR_SECURITY); 34 callback.Run(base::File::FILE_ERROR_SECURITY);
34 } 35 }
35 } 36 }
36 37
38 void ProvidedFileSystem::GetMetadata(
39 const base::FilePath& entry_path,
40 const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) {
41 if (!request_manager_.CreateRequest(
42 make_scoped_ptr<RequestManager::HandlerInterface>(
43 new operations::GetMetadata(
44 event_router_, file_system_info_, entry_path, callback)))) {
45 callback.Run(base::File::FILE_ERROR_SECURITY, base::File::Info());
46 }
47 }
48
37 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const { 49 const ProvidedFileSystemInfo& ProvidedFileSystem::GetFileSystemInfo() const {
38 return file_system_info_; 50 return file_system_info_;
39 } 51 }
40 52
41 RequestManager* ProvidedFileSystem::GetRequestManager() { 53 RequestManager* ProvidedFileSystem::GetRequestManager() {
42 return &request_manager_; 54 return &request_manager_;
43 } 55 }
44 56
45 } // namespace file_system_provider 57 } // namespace file_system_provider
46 } // namespace chromeos 58 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698