summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugins/plugin_observer.h
diff options
context:
space:
mode:
authoribraaaa@google.com <ibraaaa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-20 20:53:18 +0000
committeribraaaa@google.com <ibraaaa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-20 20:53:18 +0000
commit0f5e57f515094790fe2a8d638213c25314b8d3e8 (patch)
tree0f840c7ba459b30ba27d68929f2d7d5c6b01e41d /chrome/browser/plugins/plugin_observer.h
parent67990d826888e15984ffe09c85ecf7796fb18a79 (diff)
downloadchromium_src-0f5e57f515094790fe2a8d638213c25314b8d3e8.zip
chromium_src-0f5e57f515094790fe2a8d638213c25314b8d3e8.tar.gz
chromium_src-0f5e57f515094790fe2a8d638213c25314b8d3e8.tar.bz2
Move chrome/browser/plugin_* to chrome/browser/plugins/
TBR=jhawkins@chromium.org BUG=124396 Review URL: https://chromiumcodereview.appspot.com/10933044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugins/plugin_observer.h')
-rw-r--r--chrome/browser/plugins/plugin_observer.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/chrome/browser/plugins/plugin_observer.h b/chrome/browser/plugins/plugin_observer.h
new file mode 100644
index 0000000..d2d6e11
--- /dev/null
+++ b/chrome/browser/plugins/plugin_observer.h
@@ -0,0 +1,73 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_
+#define CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_
+
+#include "base/memory/weak_ptr.h"
+#include "content/public/browser/web_contents_observer.h"
+
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+#include <map>
+#endif
+
+class GURL;
+class InfoBarDelegate;
+class PluginFinder;
+class TabContents;
+
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+class PluginInstaller;
+class PluginPlaceholderHost;
+#endif
+
+class PluginObserver : public content::WebContentsObserver {
+ public:
+ explicit PluginObserver(TabContents* tab_contents);
+ virtual ~PluginObserver();
+
+ // content::WebContentsObserver implementation.
+ virtual void PluginCrashed(const FilePath& plugin_path) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+ void InstallMissingPlugin(PluginInstaller* installer);
+#endif
+
+ TabContents* tab_contents() { return tab_contents_; }
+
+ private:
+ class PluginPlaceholderHost;
+
+ void OnBlockedUnauthorizedPlugin(const string16& name,
+ const std::string& identifier);
+ void OnBlockedOutdatedPlugin(int placeholder_id,
+ const std::string& identifier);
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+ void OnFindMissingPlugin(int placeholder_id, const std::string& mime_type);
+
+ void FindMissingPlugin(int placeholder_id,
+ const std::string& mime_type,
+ PluginFinder* plugin_finder);
+ void FindPluginToUpdate(int placeholder_id,
+ const std::string& identifier,
+ PluginFinder* plugin_finder);
+ void OnRemovePluginPlaceholderHost(int placeholder_id);
+#endif
+ void OnOpenAboutPlugins();
+ void OnCouldNotLoadPlugin(const FilePath& plugin_path);
+
+ base::WeakPtrFactory<PluginObserver> weak_ptr_factory_;
+
+ TabContents* tab_contents_;
+
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+ // Stores all PluginPlaceholderHosts, keyed by their routing ID.
+ std::map<int, PluginPlaceholderHost*> plugin_placeholders_;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(PluginObserver);
+};
+
+#endif // CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_