| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 using api::file_system_provider::Unmount::Params; | 68 using api::file_system_provider::Unmount::Params; |
| 69 scoped_ptr<Params> params(Params::Create(*args_)); | 69 scoped_ptr<Params> params(Params::Create(*args_)); |
| 70 EXTENSION_FUNCTION_VALIDATE(params); | 70 EXTENSION_FUNCTION_VALIDATE(params); |
| 71 | 71 |
| 72 Service* service = Service::Get(GetProfile()); | 72 Service* service = Service::Get(GetProfile()); |
| 73 DCHECK(service); | 73 DCHECK(service); |
| 74 if (!service) | 74 if (!service) |
| 75 return false; | 75 return false; |
| 76 | 76 |
| 77 if (!service->UnmountFileSystem(extension_id(), | 77 if (!service->UnmountFileSystem(extension_id(), |
| 78 params->options.file_system_id)) { | 78 params->options.file_system_id, |
| 79 Service::UNMOUNT_REASON_USER)) { |
| 79 // TODO(mtomasz): Pass more detailed errors, rather than just a bool. | 80 // TODO(mtomasz): Pass more detailed errors, rather than just a bool. |
| 80 base::ListValue* result = new base::ListValue(); | 81 base::ListValue* result = new base::ListValue(); |
| 81 result->Append(CreateError(kSecurityErrorName, kUnmountFailedErrorMessage)); | 82 result->Append(CreateError(kSecurityErrorName, kUnmountFailedErrorMessage)); |
| 82 SetResult(result); | 83 SetResult(result); |
| 83 return true; | 84 return true; |
| 84 } | 85 } |
| 85 | 86 |
| 86 base::ListValue* result = new base::ListValue(); | 87 base::ListValue* result = new base::ListValue(); |
| 87 SetResult(result); | 88 SetResult(result); |
| 88 return true; | 89 return true; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 using api::file_system_provider_internal::OperationRequestedError::Params; | 153 using api::file_system_provider_internal::OperationRequestedError::Params; |
| 153 scoped_ptr<Params> params(Params::Create(*args_)); | 154 scoped_ptr<Params> params(Params::Create(*args_)); |
| 154 EXTENSION_FUNCTION_VALIDATE(params); | 155 EXTENSION_FUNCTION_VALIDATE(params); |
| 155 | 156 |
| 156 const base::File::Error error = ProviderErrorToFileError(params->error); | 157 const base::File::Error error = ProviderErrorToFileError(params->error); |
| 157 RejectRequest(RequestValue::CreateForOperationError(params.Pass()), error); | 158 RejectRequest(RequestValue::CreateForOperationError(params.Pass()), error); |
| 158 return true; | 159 return true; |
| 159 } | 160 } |
| 160 | 161 |
| 161 } // namespace extensions | 162 } // namespace extensions |
| OLD | NEW |