blob: 499ab2a139d56bd6fe1b0f757f2ca1967678bf45 [file] [log] [blame]
Jeremy Romanb7024742018-06-18 22:00:221// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_
6#define CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_
7
8#include "base/memory/weak_ptr.h"
9#include "base/time/time.h"
10#include "mojo/public/cpp/bindings/binding_set.h"
11#include "third_party/blink/public/mojom/plugins/plugin_registry.mojom.h"
12
13namespace content {
14
Jeremy Romanb7024742018-06-18 22:00:2215struct WebPluginInfo;
16
17class PluginRegistryImpl : public blink::mojom::PluginRegistry {
18 public:
Clark DuVall1df2052b2019-08-05 19:58:4619 explicit PluginRegistryImpl(int render_process_id);
Jeremy Romanb7024742018-06-18 22:00:2220 ~PluginRegistryImpl() override;
21
22 void Bind(blink::mojom::PluginRegistryRequest request);
23
24 // blink::mojom::PluginRegistry
25 void GetPlugins(bool refresh,
26 const url::Origin& main_frame_origin,
27 GetPluginsCallback callback) override;
28
29 private:
30 void GetPluginsComplete(const url::Origin& main_frame_origin,
31 GetPluginsCallback callback,
32 const std::vector<WebPluginInfo>& all_plugins);
33
Clark DuVall1df2052b2019-08-05 19:58:4634 int render_process_id_;
Jeremy Romanb7024742018-06-18 22:00:2235 mojo::BindingSet<PluginRegistry> bindings_;
36 base::TimeTicks last_plugin_refresh_time_;
Jeremy Roman3bca4bf2019-07-11 03:41:2537 base::WeakPtrFactory<PluginRegistryImpl> weak_factory_{this};
Jeremy Romanb7024742018-06-18 22:00:2238};
39
40} // namespace content
41
42#endif // CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_