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

Unified Diff: chrome/browser/plugins/plugin_observer.h

Issue 2154773002: Implement Just-In-Time Flash updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Through #39 + pepper_flash_component_installer compile fix Created 4 years, 5 months 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/plugins/plugin_observer.h
diff --git a/chrome/browser/plugins/plugin_observer.h b/chrome/browser/plugins/plugin_observer.h
index 172b06d04ab93393714d2f5b5e789dccba1b3d97..e4d0e8dd8ac52c4282acf969d825efaf3f964dde 100644
--- a/chrome/browser/plugins/plugin_observer.h
+++ b/chrome/browser/plugins/plugin_observer.h
@@ -6,9 +6,11 @@
#define CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_
#include <memory>
+#include <string>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "components/component_updater/component_updater_service.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -45,8 +47,23 @@ class PluginObserver : public content::WebContentsObserver,
content::RenderFrameHost* render_frame_host) override;
private:
+ class ComponentObserver : public update_client::UpdateClient::Observer {
Bernhard Bauer 2016/07/29 09:14:24 I think you could just declare the class here and
waffles 2016/07/29 21:07:25 Done.
+ public:
+ using Events = update_client::UpdateClient::Observer::Events;
+ ComponentObserver(PluginObserver* observer,
+ int routing_id,
+ const std::string& component_id);
+ void OnEvent(Events event, const std::string& id) override;
+
+ private:
+ PluginObserver* observer_;
+ int routing_id_;
+ std::string component_id_;
+ DISALLOW_COPY_AND_ASSIGN(ComponentObserver);
+ };
explicit PluginObserver(content::WebContents* web_contents);
friend class content::WebContentsUserData<PluginObserver>;
+ friend class ComponentObserver;
Bernhard Bauer 2016/07/29 09:14:24 I don't think this friend declaration is now neces
waffles 2016/07/29 21:07:25 Done.
class PluginPlaceholderHost;
@@ -55,9 +72,12 @@ class PluginObserver : public content::WebContentsObserver,
const std::string& identifier);
void OnBlockedOutdatedPlugin(int placeholder_id,
const std::string& identifier);
+ void OnBlockedComponentUpdatedPlugin(int placeholder_id,
+ const std::string& identifier);
#if defined(ENABLE_PLUGIN_INSTALLATION)
void OnRemovePluginPlaceholderHost(int placeholder_id);
#endif
+ void RemoveComponentObserver(int placeholder_id);
void OnOpenAboutPlugins();
void OnCouldNotLoadPlugin(const base::FilePath& plugin_path);
@@ -66,6 +86,9 @@ class PluginObserver : public content::WebContentsObserver,
std::map<int, PluginPlaceholderHost*> plugin_placeholders_;
#endif
+ // Stores all ComponentObservers, keyed by their routing ID.
+ std::map<int, std::unique_ptr<ComponentObserver>> component_observers_;
+
base::WeakPtrFactory<PluginObserver> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PluginObserver);

Powered by Google App Engine
This is Rietveld 408576698