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/memory/scoped_ptr.h" |
9 #include "base/values.h" | 10 #include "base/values.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; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 bool | 119 bool |
119 FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunWhenValid() { | 120 FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunWhenValid() { |
120 using api::file_system_provider_internal::GetMetadataRequestedError::Params; | 121 using api::file_system_provider_internal::GetMetadataRequestedError::Params; |
121 const scoped_ptr<Params> params(Params::Create(*args_)); | 122 const scoped_ptr<Params> params(Params::Create(*args_)); |
122 EXTENSION_FUNCTION_VALIDATE(params); | 123 EXTENSION_FUNCTION_VALIDATE(params); |
123 | 124 |
124 RejectRequest(ProviderErrorToFileError(params->error)); | 125 RejectRequest(ProviderErrorToFileError(params->error)); |
125 return true; | 126 return true; |
126 } | 127 } |
127 | 128 |
| 129 bool FileSystemProviderInternalReadDirectoryRequestedSuccessFunction:: |
| 130 RunWhenValid() { |
| 131 using api::file_system_provider_internal::ReadDirectoryRequestedSuccess:: |
| 132 Params; |
| 133 scoped_ptr<Params> params(Params::Create(*args_)); |
| 134 EXTENSION_FUNCTION_VALIDATE(params); |
| 135 |
| 136 const bool has_next = params->has_next; |
| 137 FulfillRequest(RequestValue::CreateForReadDirectorySuccess(params.Pass()), |
| 138 has_next); |
| 139 return true; |
| 140 } |
| 141 |
| 142 bool |
| 143 FileSystemProviderInternalReadDirectoryRequestedErrorFunction::RunWhenValid() { |
| 144 using api::file_system_provider_internal::ReadDirectoryRequestedError::Params; |
| 145 const scoped_ptr<Params> params(Params::Create(*args_)); |
| 146 EXTENSION_FUNCTION_VALIDATE(params); |
| 147 |
| 148 RejectRequest(ProviderErrorToFileError(params->error)); |
| 149 return true; |
| 150 } |
| 151 |
128 } // namespace extensions | 152 } // namespace extensions |
OLD | NEW |