Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3712)

Unified Diff: chrome/browser/ui/webui/version_handler.h

Issue 1486403002: Mojo-ifying chrome://version. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing DOMContentLoaded TODO. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698