| 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 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/chrome_extension_function_details.h" | 8 #include "chrome/browser/extensions/chrome_extension_function_details.h" |
| 9 #include "extensions/browser/extension_function.h" | 9 #include "extensions/browser/extension_function.h" |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // ValidationFailure override to match RunAsync(). | 105 // ValidationFailure override to match RunAsync(). |
| 106 static bool ValidationFailure(ChromeAsyncExtensionFunction* function); | 106 static bool ValidationFailure(ChromeAsyncExtensionFunction* function); |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 // If you're hitting a compile error here due to "final" - great! You're doing | 109 // If you're hitting a compile error here due to "final" - great! You're doing |
| 110 // the right thing, you just need to extend ChromeUIThreadExtensionFunction | 110 // the right thing, you just need to extend ChromeUIThreadExtensionFunction |
| 111 // instead of ChromeAsyncExtensionFunction. | 111 // instead of ChromeAsyncExtensionFunction. |
| 112 ResponseAction Run() final; | 112 ResponseAction Run() final; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 // A chrome specific analog to SyncExtensionFunction. This has access to a | |
| 116 // chrome Profile. | |
| 117 // | |
| 118 // DEPRECATED: Please consider inherting UIThreadExtensionFunction or | |
| 119 // SyncExtensionFunction directly. Then if you need access to Chrome details, | |
| 120 // you can construct a ChromeExtensionFunctionDetails object within your | |
| 121 // function implementation. | |
| 122 class ChromeSyncExtensionFunction : public ChromeUIThreadExtensionFunction { | |
| 123 public: | |
| 124 ChromeSyncExtensionFunction(); | |
| 125 | |
| 126 protected: | |
| 127 ~ChromeSyncExtensionFunction() override; | |
| 128 | |
| 129 // Deprecated, see SyncExtensionFunction::RunSync. | |
| 130 virtual bool RunSync() = 0; | |
| 131 | |
| 132 // ValidationFailure override to match RunSync(). | |
| 133 static bool ValidationFailure(ChromeSyncExtensionFunction* function); | |
| 134 | |
| 135 private: | |
| 136 // If you're hitting a compile error here due to "final" - great! You're doing | |
| 137 // the right thing, you just need to extend ChromeUIThreadExtensionFunction | |
| 138 // instead of ChromeSyncExtensionFunction. | |
| 139 ResponseAction Run() final; | |
| 140 }; | |
| 141 | |
| 142 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ | 115 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ |
| OLD | NEW |