| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 | 12 |
| 13 class AsyncExtensionFunction; | |
| 14 class Browser; | 13 class Browser; |
| 15 class Extension; | 14 class Extension; |
| 16 class UIThreadExtensionFunction; | 15 class UIThreadExtensionFunction; |
| 17 | 16 |
| 18 namespace base { | 17 namespace base { |
| 19 class Value; | 18 class Value; |
| 20 class DictionaryValue; | 19 class DictionaryValue; |
| 21 class ListValue; | 20 class ListValue; |
| 22 } | 21 } |
| 23 | 22 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // close to what the bindings would actually send. | 77 // close to what the bindings would actually send. |
| 79 // | 78 // |
| 80 // TODO(aa): I'm concerned that this style won't scale to all the bits and bobs | 79 // TODO(aa): I'm concerned that this style won't scale to all the bits and bobs |
| 81 // we're going to need to frob for all the different extension functions. But we | 80 // we're going to need to frob for all the different extension functions. But we |
| 82 // can refactor when we see what is needed. | 81 // can refactor when we see what is needed. |
| 83 void RunFunction(UIThreadExtensionFunction* function, | 82 void RunFunction(UIThreadExtensionFunction* function, |
| 84 const std::string& args, | 83 const std::string& args, |
| 85 Browser* browser, | 84 Browser* browser, |
| 86 RunFunctionFlags flags); | 85 RunFunctionFlags flags); |
| 87 | 86 |
| 88 // Similar to RunFunction, but doesn't return until |function| calls | |
| 89 // SendResponse. Returns the value |function| passed to SendResponse. | |
| 90 bool RunAsyncFunction(AsyncExtensionFunction* function, | |
| 91 const std::string& args, | |
| 92 Browser* browser, | |
| 93 RunFunctionFlags flags); | |
| 94 | |
| 95 } // namespace extension_function_test_utils | 87 } // namespace extension_function_test_utils |
| 96 | 88 |
| 97 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ | 89 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
| OLD | NEW |