| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // TODO(stevenjb): Replace this with GetExtensionWindowController(). | 51 // TODO(stevenjb): Replace this with GetExtensionWindowController(). |
| 52 Browser* GetCurrentBrowser(); | 52 Browser* GetCurrentBrowser(); |
| 53 | 53 |
| 54 // Same as above but uses WindowControllerList instead of BrowserList. | 54 // Same as above but uses WindowControllerList instead of BrowserList. |
| 55 extensions::WindowController* GetExtensionWindowController(); | 55 extensions::WindowController* GetExtensionWindowController(); |
| 56 | 56 |
| 57 // Gets the "current" web contents if any. If there is no associated web | 57 // Gets the "current" web contents if any. If there is no associated web |
| 58 // contents then defaults to the foremost one. | 58 // contents then defaults to the foremost one. |
| 59 content::WebContents* GetAssociatedWebContents() override; | 59 content::WebContents* GetAssociatedWebContents() override; |
| 60 | 60 |
| 61 // Responds with success/failure. |results_| or |error_| should be set |
| 62 // accordingly. |
| 63 void SendResponse(bool success); |
| 64 |
| 61 protected: | 65 protected: |
| 62 ~ChromeUIThreadExtensionFunction() override; | 66 ~ChromeUIThreadExtensionFunction() override; |
| 63 | 67 |
| 64 private: | 68 private: |
| 65 ChromeExtensionFunctionDetails chrome_details_; | 69 ChromeExtensionFunctionDetails chrome_details_; |
| 66 }; | 70 }; |
| 67 | 71 |
| 68 // A chrome specific analog to AsyncExtensionFunction. This has access to a | 72 // A chrome specific analog to AsyncExtensionFunction. This has access to a |
| 69 // chrome Profile. | 73 // chrome Profile. |
| 70 // | 74 // |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 static bool ValidationFailure(ChromeSyncExtensionFunction* function); | 117 static bool ValidationFailure(ChromeSyncExtensionFunction* function); |
| 114 | 118 |
| 115 private: | 119 private: |
| 116 // If you're hitting a compile error here due to "final" - great! You're doing | 120 // If you're hitting a compile error here due to "final" - great! You're doing |
| 117 // the right thing, you just need to extend ChromeUIThreadExtensionFunction | 121 // the right thing, you just need to extend ChromeUIThreadExtensionFunction |
| 118 // instead of ChromeSyncExtensionFunction. | 122 // instead of ChromeSyncExtensionFunction. |
| 119 ResponseAction Run() final; | 123 ResponseAction Run() final; |
| 120 }; | 124 }; |
| 121 | 125 |
| 122 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ | 126 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ |
| OLD | NEW |