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/extensions/file_system_provider/file_system_pr
ovider_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_system_provider/file_system_pr
ovider_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
11 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 12 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
12 #include "chrome/browser/chromeos/file_system_provider/request_value.h" | 13 #include "chrome/browser/chromeos/file_system_provider/request_value.h" |
13 #include "chrome/browser/chromeos/file_system_provider/service.h" | 14 #include "chrome/browser/chromeos/file_system_provider/service.h" |
14 #include "chrome/common/extensions/api/file_system_provider.h" | 15 #include "chrome/common/extensions/api/file_system_provider.h" |
15 #include "chrome/common/extensions/api/file_system_provider_internal.h" | 16 #include "chrome/common/extensions/api/file_system_provider_internal.h" |
16 | 17 |
17 using chromeos::file_system_provider::ProvidedFileSystemInterface; | 18 using chromeos::file_system_provider::ProvidedFileSystemInterface; |
18 using chromeos::file_system_provider::RequestValue; | 19 using chromeos::file_system_provider::RequestValue; |
19 using chromeos::file_system_provider::Service; | 20 using chromeos::file_system_provider::Service; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 117 |
117 bool FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunSync() { | 118 bool FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunSync() { |
118 using api::file_system_provider_internal::GetMetadataRequestedError::Params; | 119 using api::file_system_provider_internal::GetMetadataRequestedError::Params; |
119 const scoped_ptr<Params> params(Params::Create(*args_)); | 120 const scoped_ptr<Params> params(Params::Create(*args_)); |
120 EXTENSION_FUNCTION_VALIDATE(params); | 121 EXTENSION_FUNCTION_VALIDATE(params); |
121 | 122 |
122 RejectRequest(ProviderErrorToFileError(params->error)); | 123 RejectRequest(ProviderErrorToFileError(params->error)); |
123 return true; | 124 return true; |
124 } | 125 } |
125 | 126 |
| 127 bool |
| 128 FileSystemProviderInternalReadDirectoryRequestedSuccessFunction::RunSync() { |
| 129 using api::file_system_provider_internal::ReadDirectoryRequestedSuccess:: |
| 130 Params; |
| 131 scoped_ptr<Params> params(Params::Create(*args_)); |
| 132 EXTENSION_FUNCTION_VALIDATE(params); |
| 133 |
| 134 const bool has_next = params->has_next; |
| 135 FulfillRequest(RequestValue::CreateForReadDirectorySuccess(params.Pass()), |
| 136 has_next); |
| 137 return true; |
| 138 } |
| 139 |
| 140 bool FileSystemProviderInternalReadDirectoryRequestedErrorFunction::RunSync() { |
| 141 using api::file_system_provider_internal::ReadDirectoryRequestedError::Params; |
| 142 const scoped_ptr<Params> params(Params::Create(*args_)); |
| 143 EXTENSION_FUNCTION_VALIDATE(params); |
| 144 |
| 145 RejectRequest(ProviderErrorToFileError(params->error)); |
| 146 return true; |
| 147 } |
| 148 |
126 } // namespace extensions | 149 } // namespace extensions |
OLD | NEW |