| 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 Service* service = Service::Get(GetProfile()); | 47 Service* service = Service::Get(GetProfile()); |
| 48 DCHECK(service); | 48 DCHECK(service); |
| 49 if (!service) | 49 if (!service) |
| 50 return false; | 50 return false; |
| 51 | 51 |
| 52 // TODO(mtomasz): Pass more detailed errors, rather than just a bool. | 52 // TODO(mtomasz): Pass more detailed errors, rather than just a bool. |
| 53 if (!service->MountFileSystem(extension_id(), | 53 if (!service->MountFileSystem(extension_id(), |
| 54 params->options.file_system_id, | 54 params->options.file_system_id, |
| 55 params->options.display_name)) { | 55 params->options.display_name, |
| 56 params->options.writable)) { |
| 56 base::ListValue* result = new base::ListValue(); | 57 base::ListValue* result = new base::ListValue(); |
| 57 result->Append(CreateError(kSecurityErrorName, kMountFailedErrorMessage)); | 58 result->Append(CreateError(kSecurityErrorName, kMountFailedErrorMessage)); |
| 58 SetResult(result); | 59 SetResult(result); |
| 59 return true; | 60 return true; |
| 60 } | 61 } |
| 61 | 62 |
| 62 base::ListValue* result = new base::ListValue(); | 63 base::ListValue* result = new base::ListValue(); |
| 63 SetResult(result); | 64 SetResult(result); |
| 64 return true; | 65 return true; |
| 65 } | 66 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 using api::file_system_provider_internal::OperationRequestedError::Params; | 154 using api::file_system_provider_internal::OperationRequestedError::Params; |
| 154 scoped_ptr<Params> params(Params::Create(*args_)); | 155 scoped_ptr<Params> params(Params::Create(*args_)); |
| 155 EXTENSION_FUNCTION_VALIDATE(params); | 156 EXTENSION_FUNCTION_VALIDATE(params); |
| 156 | 157 |
| 157 const base::File::Error error = ProviderErrorToFileError(params->error); | 158 const base::File::Error error = ProviderErrorToFileError(params->error); |
| 158 RejectRequest(RequestValue::CreateForOperationError(params.Pass()), error); | 159 RejectRequest(RequestValue::CreateForOperationError(params.Pass()), error); |
| 159 return true; | 160 return true; |
| 160 } | 161 } |
| 161 | 162 |
| 162 } // namespace extensions | 163 } // namespace extensions |
| OLD | NEW |