| 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 d121739f25c589335cbe79cec27ae6cee04f603e..908983861ea3f5e73b02d1349ed7ee3756b74188 100644
|
| --- a/chrome/browser/ui/webui/version_handler.h
|
| +++ b/chrome/browser/ui/webui/version_handler.h
|
| @@ -10,32 +10,48 @@
|
| #include "base/macros.h"
|
| #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 "components/version_ui/version.mojom.h"
|
| +#include "content/public/browser/web_ui.h"
|
| #include "content/public/common/webplugininfo.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
|
|
| // Handler class for Version page operations.
|
| -class VersionHandler : public content::WebUIMessageHandler {
|
| +class VersionHandler : public MojoWebUIHandler,
|
| + public mojom::VersionPageHandler {
|
| public:
|
| - VersionHandler();
|
| + VersionHandler(content::WebUI* web_ui,
|
| + mojo::InterfaceRequest<VersionPageHandler> 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);
|
| + // mojom::VersionPageHandler 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;
|
| + void GetArcVersion(const GetArcVersionCallback& 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.
|
| - void OnGotPlugins(const std::vector<content::WebPluginInfo>& plugins);
|
| + 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);
|
| + void OnGotArcVersion(const GetOsVersionCallback& callback,
|
| + const std::string& version);
|
| +#endif // defined(OS_CHROMEOS)
|
| +
|
| + content::WebUI* web_ui_;
|
| + mojo::Binding<mojom::VersionPageHandler> binding_;
|
|
|
| // Factory for the creating refs in callbacks.
|
| base::WeakPtrFactory<VersionHandler> weak_ptr_factory_;
|
|
|