OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <list> | 9 #include <list> |
10 | 10 |
11 #include "base/values.h" | 11 #include "base/values.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 void SendResponse(bool success); | 170 void SendResponse(bool success); |
171 | 171 |
172 const ListValue* args_as_list() { | 172 const ListValue* args_as_list() { |
173 return static_cast<ListValue*>(args_.get()); | 173 return static_cast<ListValue*>(args_.get()); |
174 } | 174 } |
175 const DictionaryValue* args_as_dictionary() { | 175 const DictionaryValue* args_as_dictionary() { |
176 return static_cast<DictionaryValue*>(args_.get()); | 176 return static_cast<DictionaryValue*>(args_.get()); |
177 } | 177 } |
178 | 178 |
| 179 bool HasOptionalArgument(size_t index); |
| 180 |
179 // Note: After Run() returns, dispatcher() can be NULL. Since these getters | 181 // Note: After Run() returns, dispatcher() can be NULL. Since these getters |
180 // rely on dispatcher(), make sure it is valid before using them. | 182 // rely on dispatcher(), make sure it is valid before using them. |
181 std::string extension_id(); | 183 std::string extension_id(); |
182 Profile* profile() const; | 184 Profile* profile() const; |
183 | 185 |
184 // The arguments to the API. Only non-null if argument were specified. | 186 // The arguments to the API. Only non-null if argument were specified. |
185 scoped_ptr<Value> args_; | 187 scoped_ptr<Value> args_; |
186 | 188 |
187 // The result of the API. This should be populated by the derived class before | 189 // The result of the API. This should be populated by the derived class before |
188 // SendResponse() is called. | 190 // SendResponse() is called. |
(...skipping 30 matching lines...) Expand all Loading... |
219 } | 221 } |
220 | 222 |
221 protected: | 223 protected: |
222 virtual ~SyncExtensionFunction() {} | 224 virtual ~SyncExtensionFunction() {} |
223 | 225 |
224 private: | 226 private: |
225 DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction); | 227 DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction); |
226 }; | 228 }; |
227 | 229 |
228 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 230 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
OLD | NEW |