Chromium Code Reviews| 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 "extensions/browser/extension_function.h" | 9 #include "extensions/browser/extension_function.h" |
| 9 | 10 |
| 10 class Browser; | 11 class Browser; |
| 11 class Profile; | 12 class Profile; |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 class WebContents; | 15 class WebContents; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace extensions { | 18 namespace extensions { |
| 18 class WindowController; | 19 class WindowController; |
| 19 } | 20 } |
| 20 | 21 |
| 21 // A chrome specific analog to AsyncExtensionFunction. This has access to a | 22 // A chrome specific analog to AsyncExtensionFunction. This has access to a |
| 22 // chrome Profile. | 23 // chrome Profile. |
| 23 // | 24 // |
| 24 // DEPRECATED: Please consider inherting UIThreadExtensionFunction directly. | 25 // DEPRECATED: Please consider inherting UIThreadExtensionFunction directly. |
|
lazyboy
2016/08/31 20:48:24
This message isn't quite right anymore.
Given we
Devlin
2016/08/31 20:56:39
Why isn't the message correct? We are deprecated
lazyboy
2016/08/31 21:21:42
I was looking at the ChromeExtensionFunctionDetail
| |
| 25 // Then if you need access to Chrome details, you can construct a | 26 // Then if you need access to Chrome details, you can construct a |
| 26 // ChromeExtensionFunctionDetails object within your function implementation. | 27 // ChromeExtensionFunctionDetails object within your function implementation. |
| 27 class ChromeUIThreadExtensionFunction : public UIThreadExtensionFunction { | 28 class ChromeUIThreadExtensionFunction : public UIThreadExtensionFunction { |
| 28 public: | 29 public: |
| 29 ChromeUIThreadExtensionFunction(); | 30 ChromeUIThreadExtensionFunction(); |
| 30 | 31 |
| 31 Profile* GetProfile() const; | 32 Profile* GetProfile() const; |
| 32 | 33 |
| 33 // Gets the "current" browser, if any. | 34 // Gets the "current" browser, if any. |
| 34 // | 35 // |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 52 | 53 |
| 53 // Same as above but uses WindowControllerList instead of BrowserList. | 54 // Same as above but uses WindowControllerList instead of BrowserList. |
| 54 extensions::WindowController* GetExtensionWindowController(); | 55 extensions::WindowController* GetExtensionWindowController(); |
| 55 | 56 |
| 56 // 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 |
| 57 // contents then defaults to the foremost one. | 58 // contents then defaults to the foremost one. |
| 58 content::WebContents* GetAssociatedWebContents() override; | 59 content::WebContents* GetAssociatedWebContents() override; |
| 59 | 60 |
| 60 protected: | 61 protected: |
| 61 ~ChromeUIThreadExtensionFunction() override; | 62 ~ChromeUIThreadExtensionFunction() override; |
| 63 | |
| 64 private: | |
| 65 ChromeExtensionFunctionDetails chrome_details_; | |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 // A chrome specific analog to AsyncExtensionFunction. This has access to a | 68 // A chrome specific analog to AsyncExtensionFunction. This has access to a |
| 65 // chrome Profile. | 69 // chrome Profile. |
| 66 // | 70 // |
| 67 // DEPRECATED: Please consider inherting UIThreadExtensionFunction or | 71 // DEPRECATED: Please consider inherting UIThreadExtensionFunction or |
| 68 // AsyncExtensionFunction directly. Then if you need access to Chrome details, | 72 // AsyncExtensionFunction directly. Then if you need access to Chrome details, |
| 69 // you can construct a ChromeExtensionFunctionDetails object within your | 73 // you can construct a ChromeExtensionFunctionDetails object within your |
| 70 // function implementation. | 74 // function implementation. |
| 71 class ChromeAsyncExtensionFunction : public ChromeUIThreadExtensionFunction { | 75 class ChromeAsyncExtensionFunction : public ChromeUIThreadExtensionFunction { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 static bool ValidationFailure(ChromeSyncExtensionFunction* function); | 113 static bool ValidationFailure(ChromeSyncExtensionFunction* function); |
| 110 | 114 |
| 111 private: | 115 private: |
| 112 // If you're hitting a compile error here due to "final" - great! You're doing | 116 // If you're hitting a compile error here due to "final" - great! You're doing |
| 113 // the right thing, you just need to extend ChromeUIThreadExtensionFunction | 117 // the right thing, you just need to extend ChromeUIThreadExtensionFunction |
| 114 // instead of ChromeSyncExtensionFunction. | 118 // instead of ChromeSyncExtensionFunction. |
| 115 ResponseAction Run() final; | 119 ResponseAction Run() final; |
| 116 }; | 120 }; |
| 117 | 121 |
| 118 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ | 122 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ |
| OLD | NEW |