1. Token CRCs are not handled correctly. This adds the corrected Whispernet binary...
[chromium-blink-merge.git] / chrome / browser / plugins / plugin_observer.h
bloba084bb110da8e1d2c95c6faf226a25f859620d29
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_
6 #define CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "content/public/browser/web_contents_observer.h"
11 #include "content/public/browser/web_contents_user_data.h"
13 #if defined(ENABLE_PLUGIN_INSTALLATION)
14 #include <map>
15 #endif
17 class GURL;
18 class PluginFinder;
19 class PluginMetadata;
21 #if defined(ENABLE_PLUGIN_INSTALLATION)
22 class PluginInstaller;
23 class PluginPlaceholderHost;
24 #endif
26 namespace content {
27 class WebContents;
30 namespace infobars {
31 class InfoBarDelegate;
34 class PluginObserver : public content::WebContentsObserver,
35 public content::WebContentsUserData<PluginObserver> {
36 public:
37 ~PluginObserver() override;
39 // content::WebContentsObserver implementation.
40 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
41 void PluginCrashed(const base::FilePath& plugin_path,
42 base::ProcessId plugin_pid) override;
43 bool OnMessageReceived(const IPC::Message& message,
44 content::RenderFrameHost* render_frame_host) override;
45 bool OnMessageReceived(const IPC::Message& message) override;
47 private:
48 explicit PluginObserver(content::WebContents* web_contents);
49 friend class content::WebContentsUserData<PluginObserver>;
51 class PluginPlaceholderHost;
53 #if defined(ENABLE_PLUGIN_INSTALLATION)
54 void InstallMissingPlugin(PluginInstaller* installer,
55 const PluginMetadata* plugin_metadata);
56 #endif
58 // Message handlers:
59 void OnBlockedUnauthorizedPlugin(const base::string16& name,
60 const std::string& identifier);
61 void OnBlockedOutdatedPlugin(int placeholder_id,
62 const std::string& identifier);
63 #if defined(ENABLE_PLUGIN_INSTALLATION)
64 void OnFindMissingPlugin(int placeholder_id, const std::string& mime_type);
66 void OnRemovePluginPlaceholderHost(int placeholder_id);
67 #endif
68 void OnOpenAboutPlugins();
69 void OnCouldNotLoadPlugin(const base::FilePath& plugin_path);
70 void OnNPAPINotSupported(const std::string& identifier);
72 #if defined(ENABLE_PLUGIN_INSTALLATION)
73 // Stores all PluginPlaceholderHosts, keyed by their routing ID.
74 std::map<int, PluginPlaceholderHost*> plugin_placeholders_;
75 #endif
77 base::WeakPtrFactory<PluginObserver> weak_ptr_factory_;
79 DISALLOW_COPY_AND_ASSIGN(PluginObserver);
82 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_