Index: chrome/browser/extensions/chrome_extension_function.h |
diff --git a/chrome/browser/extensions/chrome_extension_function.h b/chrome/browser/extensions/chrome_extension_function.h |
index a556085562dbf13e8e890d95ba37327bc9d5243f..59d5e1e0ad19324de4bbbe795683da57d1149514 100644 |
--- a/chrome/browser/extensions/chrome_extension_function.h |
+++ b/chrome/browser/extensions/chrome_extension_function.h |
@@ -54,16 +54,31 @@ class ChromeUIThreadExtensionFunction : public UIThreadExtensionFunction { |
// Same as above but uses WindowControllerList instead of BrowserList. |
extensions::WindowController* GetExtensionWindowController(); |
- // Gets the "current" web contents if any. If there is no associated web |
- // contents then defaults to the foremost one. |
+ // ExtensionFunction: |
content::WebContents* GetAssociatedWebContents() override; |
+ void SetError(const std::string& error) override; |
+ const std::string& GetError() const override; |
+ |
+ protected: |
+ ~ChromeUIThreadExtensionFunction() override; |
// Responds with success/failure. |results_| or |error_| should be set |
// accordingly. |
void SendResponse(bool success); |
- protected: |
- ~ChromeUIThreadExtensionFunction() override; |
+ // Sets a single Value as the results of the function. |
+ void SetResult(std::unique_ptr<base::Value> result); |
+ |
+ // Sets multiple Values as the results of the function. |
+ void SetResultList(std::unique_ptr<base::ListValue> results); |
+ |
+ // Exposed versions of ExtensionFunction::results_ and |
+ // ExtensionFunction::error_ that are curried into the response. |
+ // These need to keep the same name to avoid breaking existing |
+ // implementations, but this should be temporary with crbug.com/648275 |
+ // and crbug.com/634140. |
+ std::unique_ptr<base::ListValue> results_; |
+ std::string error_; |
private: |
ChromeExtensionFunctionDetails chrome_details_; |