| Index: chrome/browser/ui/webui/plugins/plugins_handler.h
|
| diff --git a/chrome/browser/ui/webui/plugins/plugins_handler.h b/chrome/browser/ui/webui/plugins/plugins_handler.h
|
| index 2fba979650f42a596a4c8743d7b7df06d3601cc7..4733364597ae9fa6a7892e0e07e0056d0a98f50e 100644
|
| --- a/chrome/browser/ui/webui/plugins/plugins_handler.h
|
| +++ b/chrome/browser/ui/webui/plugins/plugins_handler.h
|
| @@ -8,20 +8,32 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/prefs/pref_member.h"
|
| #include "base/values.h"
|
| +#include "chrome/browser/ui/webui/mojo_web_ui_handler.h"
|
| +#include "chrome/browser/ui/webui/plugins/plugins.mojom.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "content/public/browser/notification_source.h"
|
| #include "content/public/browser/web_ui_message_handler.h"
|
| #include "content/public/common/webplugininfo.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
|
|
| -class PluginsHandler : public content::WebUIMessageHandler,
|
| - public content::NotificationObserver {
|
| +class PluginsHandler :
|
| + public MojoWebUIHandler, public PluginsHandlerMojo,
|
| + public content::NotificationObserver {
|
| public:
|
| - PluginsHandler();
|
| + PluginsHandler(content::WebUI* web_ui,
|
| + mojo::InterfaceRequest<PluginsHandlerMojo> request);
|
| ~PluginsHandler() override;
|
|
|
| - // content::WebUIMessageHandler implementation.
|
| - void RegisterMessages() override;
|
| + // PluginsHandlerMojo overrides:
|
| + void GetPluginsData(const GetPluginsDataCallback& callback) override;
|
| + void GetShowDetails(const GetShowDetailsCallback& callback) override;
|
| + void SaveShowDetailsToPrefs(bool details_mode) override;
|
| + void SetPluginAlwaysAllowed(
|
| + const mojo::String& plugin, bool allowed) override;
|
| + void SetPluginEnabled(const mojo::String& plugin_path, bool enable) override;
|
| + void SetPluginGroupEnabled(const mojo::String& group_name, bool enable)
|
| + override;
|
|
|
| // content::NotificationObserver implementation.
|
| void Observe(int type,
|
| @@ -47,7 +59,9 @@ class PluginsHandler : public content::WebUIMessageHandler,
|
| void LoadPlugins();
|
|
|
| // Called on the UI thread when the plugin information is ready.
|
| - void PluginsLoaded(const std::vector<content::WebPluginInfo>& plugins);
|
| + void PluginsLoaded(
|
| + const GetPluginsDataCallback& callback,
|
| + const std::vector<content::WebPluginInfo>& plugins);
|
|
|
| // Detect a plugin's enabled mode (one of enabledByUser, disabledByUser,
|
| // enabledByPolicy, disabledByPolicy).
|
| @@ -57,8 +71,13 @@ class PluginsHandler : public content::WebUIMessageHandler,
|
|
|
| // Detect a plugin group's enabled mode (one of enabledByUser, disabledByUser,
|
| // enabledByPolicy, disabledByPolicy, managedByPolicy).
|
| - std::string GetPluginGroupEnabledMode(const base::ListValue& plugin_files,
|
| - bool group_enabled) const;
|
| + std::string GetPluginGroupEnabledMode(
|
| + const mojo::Array<PluginFilePtr>& plugin_files,
|
| + bool group_enabled) const;
|
| +
|
| + PluginFilePtr GetPluginFile(const content::WebPluginInfo& plugin,
|
| + const base::string16& group_name,
|
| + bool plugin_enabled) const;
|
|
|
| content::NotificationRegistrar registrar_;
|
|
|
| @@ -66,6 +85,9 @@ class PluginsHandler : public content::WebUIMessageHandler,
|
| // not.
|
| BooleanPrefMember show_details_;
|
|
|
| + content::WebUI* web_ui_;
|
| + mojo::Binding<PluginsHandlerMojo> binding_;
|
| +
|
| base::WeakPtrFactory<PluginsHandler> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PluginsHandler);
|
|
|