Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / file_system_provider / request_value.h
blob5c2ea683b3ab2c2ef4a7fd2d1dca4aa4f1fe9f68
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REQUEST_VALUE_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REQUEST_VALUE_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/common/extensions/api/file_system_provider_internal.h"
13 namespace chromeos {
14 namespace file_system_provider {
16 // Holds a parsed value returned by a providing extension. Each accessor can
17 // return NULL in case the requested value type is not available. It is used
18 // to pass values of success callbacks.
19 class RequestValue {
20 public:
21 // Creates an empty value. Use static methods to create a value holding a
22 // proper content.
23 RequestValue();
25 virtual ~RequestValue();
27 static scoped_ptr<RequestValue> CreateForUnmountSuccess(
28 scoped_ptr<extensions::api::file_system_provider_internal::
29 UnmountRequestedSuccess::Params> params);
31 static scoped_ptr<RequestValue> CreateForGetMetadataSuccess(
32 scoped_ptr<extensions::api::file_system_provider_internal::
33 GetMetadataRequestedSuccess::Params> params);
35 static scoped_ptr<RequestValue> CreateForReadDirectorySuccess(
36 scoped_ptr<extensions::api::file_system_provider_internal::
37 ReadDirectoryRequestedSuccess::Params> params);
39 static scoped_ptr<RequestValue> CreateForReadFileSuccess(
40 scoped_ptr<extensions::api::file_system_provider_internal::
41 ReadFileRequestedSuccess::Params> params);
43 static scoped_ptr<RequestValue> CreateForOperationSuccess(
44 scoped_ptr<extensions::api::file_system_provider_internal::
45 OperationRequestedSuccess::Params> params);
47 static scoped_ptr<RequestValue> CreateForOperationError(
48 scoped_ptr<extensions::api::file_system_provider_internal::
49 OperationRequestedError::Params> params);
51 static scoped_ptr<RequestValue> CreateForTesting(const std::string& params);
53 const extensions::api::file_system_provider_internal::
54 UnmountRequestedSuccess::Params*
55 unmount_success_params() const {
56 return unmount_success_params_.get();
59 const extensions::api::file_system_provider_internal::
60 GetMetadataRequestedSuccess::Params*
61 get_metadata_success_params() const {
62 return get_metadata_success_params_.get();
65 const extensions::api::file_system_provider_internal::
66 ReadDirectoryRequestedSuccess::Params*
67 read_directory_success_params() const {
68 return read_directory_success_params_.get();
71 const extensions::api::file_system_provider_internal::
72 ReadFileRequestedSuccess::Params*
73 read_file_success_params() const {
74 return read_file_success_params_.get();
77 const extensions::api::file_system_provider_internal::
78 OperationRequestedSuccess::Params*
79 operation_success_params() const {
80 return operation_success_params_.get();
83 const extensions::api::file_system_provider_internal::
84 OperationRequestedError::Params*
85 operation_error_params() const {
86 return operation_error_params_.get();
89 const std::string* testing_params() const { return testing_params_.get(); }
91 private:
92 scoped_ptr<extensions::api::file_system_provider_internal::
93 UnmountRequestedSuccess::Params> unmount_success_params_;
94 scoped_ptr<extensions::api::file_system_provider_internal::
95 GetMetadataRequestedSuccess::Params>
96 get_metadata_success_params_;
97 scoped_ptr<extensions::api::file_system_provider_internal::
98 ReadDirectoryRequestedSuccess::Params>
99 read_directory_success_params_;
100 scoped_ptr<extensions::api::file_system_provider_internal::
101 ReadFileRequestedSuccess::Params> read_file_success_params_;
102 scoped_ptr<extensions::api::file_system_provider_internal::
103 OperationRequestedSuccess::Params> operation_success_params_;
104 scoped_ptr<extensions::api::file_system_provider_internal::
105 OperationRequestedError::Params> operation_error_params_;
106 scoped_ptr<std::string> testing_params_;
108 DISALLOW_COPY_AND_ASSIGN(RequestValue);
111 } // namespace file_system_provider
112 } // namespace chromeos
114 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REQUEST_VALUE_H_