Chromium Code Reviews| Index: chrome/browser/ui/webui/version_handler.h |
| diff --git a/chrome/browser/ui/webui/version_handler.h b/chrome/browser/ui/webui/version_handler.h |
| index b7f272a90a82c352bc67ad90497b32035f6d2e3e..8d174376e3253977be9db8c2fbcfeb3860e95912 100644 |
| --- a/chrome/browser/ui/webui/version_handler.h |
| +++ b/chrome/browser/ui/webui/version_handler.h |
| @@ -9,32 +9,45 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "base/values.h" |
| -#include "content/public/browser/web_ui_message_handler.h" |
| +#include "chrome/browser/ui/webui/mojo_web_ui_handler.h" |
| +#include "chrome/browser/ui/webui/version.mojom.h" |
| +#include "content/public/browser/web_ui.h" |
| #include "content/public/common/webplugininfo.h" |
| +#include "mojo/public/cpp/bindings/strong_binding.h" |
| // Handler class for Version page operations. |
| -class VersionHandler : public content::WebUIMessageHandler { |
| +class VersionHandler : public MojoWebUIHandler, public VersionHandlerMojo { |
| public: |
| - VersionHandler(); |
| + VersionHandler(content::WebUI* web_ui, |
| + mojo::InterfaceRequest<VersionHandlerMojo> request); |
| ~VersionHandler() override; |
| - // content::WebUIMessageHandler implementation. |
| - void RegisterMessages() override; |
| - |
| - // Callback for the "requestVersionInfo" message. This asynchronously requests |
| - // the flash version and eventually returns it to the front end along with the |
| - // list of variations using OnGotPlugins. |
| - virtual void HandleRequestVersionInfo(const base::ListValue* args); |
| + // VersionHandlerMojo overrides: |
| + void GetFilePaths(const GetFilePathsCallback& callback) override; |
| + void GetFlashVersion(const GetFlashVersionCallback& callback) override; |
| + void GetVariations(const GetVariationsCallback& callback) override; |
| + void GetOsVersion(const GetOsVersionCallback& callback) override; |
| private: |
| // Callback which handles returning the executable and profile paths to the |
| // front end. |
| void OnGotFilePaths(base::string16* executable_path_data, |
| - base::string16* profile_path_data); |
| + base::string16* profile_path_data, |
| + const GetFilePathsCallback& callback); |
| +#if defined(ENABLE_PLUGINS) |
| // Callback for GetPlugins which responds to the page with the Flash version. |
| // This also initiates the OS Version load on ChromeOS. |
|
Dan Beam
2015/12/09 21:45:07
that's weird
dpapad
2015/12/10 01:08:27
Indeed. Removed that comment, it made no sense.
|
| - void OnGotPlugins(const std::vector<content::WebPluginInfo>& plugins); |
|
Dan Beam
2015/12/09 21:45:07
it's weird that this existed on iOS
dpapad
2015/12/10 01:08:27
What makes you think it existed? The IOS handler i
|
| + void OnGotPlugins(const GetFlashVersionCallback& callback, |
| + const std::vector<content::WebPluginInfo>& plugins); |
| +#endif // defined(ENABLE_PLUGINS) |
| +#if defined(OS_CHROMEOS) |
| + void OnGotOsVersion(const GetOsVersionCallback& callback, |
| + const std::string& version); |
| +#endif // defined(OS_CHROMEOS) |
| + |
| + content::WebUI* web_ui_; |
| + mojo::StrongBinding<VersionHandlerMojo> binding_; |
| // Factory for the creating refs in callbacks. |
| base::WeakPtrFactory<VersionHandler> weak_ptr_factory_; |