BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / chromeos / file_system_provider / request_value.h
blobf68483be5500eea19e29cad19e34a0ae3149a44e
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> CreateForGetActionsSuccess(
36 scoped_ptr<extensions::api::file_system_provider_internal::
37 GetActionsRequestedSuccess::Params> params);
39 static scoped_ptr<RequestValue> CreateForReadDirectorySuccess(
40 scoped_ptr<extensions::api::file_system_provider_internal::
41 ReadDirectoryRequestedSuccess::Params> params);
43 static scoped_ptr<RequestValue> CreateForReadFileSuccess(
44 scoped_ptr<extensions::api::file_system_provider_internal::
45 ReadFileRequestedSuccess::Params> params);
47 static scoped_ptr<RequestValue> CreateForOperationSuccess(
48 scoped_ptr<extensions::api::file_system_provider_internal::
49 OperationRequestedSuccess::Params> params);
51 static scoped_ptr<RequestValue> CreateForOperationError(
52 scoped_ptr<extensions::api::file_system_provider_internal::
53 OperationRequestedError::Params> params);
55 static scoped_ptr<RequestValue> CreateForTesting(const std::string& params);
57 const extensions::api::file_system_provider_internal::
58 UnmountRequestedSuccess::Params*
59 unmount_success_params() const {
60 return unmount_success_params_.get();
63 const extensions::api::file_system_provider_internal::
64 GetMetadataRequestedSuccess::Params*
65 get_metadata_success_params() const {
66 return get_metadata_success_params_.get();
69 const extensions::api::file_system_provider_internal::
70 GetActionsRequestedSuccess::Params*
71 get_actions_success_params() const {
72 return get_actions_success_params_.get();
75 const extensions::api::file_system_provider_internal::
76 ReadDirectoryRequestedSuccess::Params*
77 read_directory_success_params() const {
78 return read_directory_success_params_.get();
81 const extensions::api::file_system_provider_internal::
82 ReadFileRequestedSuccess::Params*
83 read_file_success_params() const {
84 return read_file_success_params_.get();
87 const extensions::api::file_system_provider_internal::
88 OperationRequestedSuccess::Params*
89 operation_success_params() const {
90 return operation_success_params_.get();
93 const extensions::api::file_system_provider_internal::
94 OperationRequestedError::Params*
95 operation_error_params() const {
96 return operation_error_params_.get();
99 const std::string* testing_params() const { return testing_params_.get(); }
101 private:
102 scoped_ptr<extensions::api::file_system_provider_internal::
103 UnmountRequestedSuccess::Params> unmount_success_params_;
104 scoped_ptr<extensions::api::file_system_provider_internal::
105 GetMetadataRequestedSuccess::Params>
106 get_metadata_success_params_;
107 scoped_ptr<extensions::api::file_system_provider_internal::
108 GetActionsRequestedSuccess::Params>
109 get_actions_success_params_;
110 scoped_ptr<extensions::api::file_system_provider_internal::
111 ReadDirectoryRequestedSuccess::Params>
112 read_directory_success_params_;
113 scoped_ptr<extensions::api::file_system_provider_internal::
114 ReadFileRequestedSuccess::Params> read_file_success_params_;
115 scoped_ptr<extensions::api::file_system_provider_internal::
116 OperationRequestedSuccess::Params> operation_success_params_;
117 scoped_ptr<extensions::api::file_system_provider_internal::
118 OperationRequestedError::Params> operation_error_params_;
119 scoped_ptr<std::string> testing_params_;
121 DISALLOW_COPY_AND_ASSIGN(RequestValue);
124 } // namespace file_system_provider
125 } // namespace chromeos
127 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_REQUEST_VALUE_H_