OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_ |
6 #define CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_ | 6 #define CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 class WebContents; | 27 class WebContents; |
28 } | 28 } |
29 | 29 |
30 namespace infobars { | 30 namespace infobars { |
31 class InfoBarDelegate; | 31 class InfoBarDelegate; |
32 } | 32 } |
33 | 33 |
34 class PluginObserver : public content::WebContentsObserver, | 34 class PluginObserver : public content::WebContentsObserver, |
35 public content::WebContentsUserData<PluginObserver> { | 35 public content::WebContentsUserData<PluginObserver> { |
36 public: | 36 public: |
37 virtual ~PluginObserver(); | 37 ~PluginObserver() override; |
38 | 38 |
39 // content::WebContentsObserver implementation. | 39 // content::WebContentsObserver implementation. |
40 virtual void RenderFrameCreated( | 40 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; |
41 content::RenderFrameHost* render_frame_host) override; | 41 void PluginCrashed(const base::FilePath& plugin_path, |
42 virtual void PluginCrashed(const base::FilePath& plugin_path, | 42 base::ProcessId plugin_pid) override; |
43 base::ProcessId plugin_pid) override; | 43 bool OnMessageReceived(const IPC::Message& message, |
44 virtual bool OnMessageReceived( | 44 content::RenderFrameHost* render_frame_host) override; |
45 const IPC::Message& message, | 45 bool OnMessageReceived(const IPC::Message& message) override; |
46 content::RenderFrameHost* render_frame_host) override; | |
47 virtual bool OnMessageReceived(const IPC::Message& message) override; | |
48 | 46 |
49 private: | 47 private: |
50 explicit PluginObserver(content::WebContents* web_contents); | 48 explicit PluginObserver(content::WebContents* web_contents); |
51 friend class content::WebContentsUserData<PluginObserver>; | 49 friend class content::WebContentsUserData<PluginObserver>; |
52 | 50 |
53 class PluginPlaceholderHost; | 51 class PluginPlaceholderHost; |
54 | 52 |
55 #if defined(ENABLE_PLUGIN_INSTALLATION) | 53 #if defined(ENABLE_PLUGIN_INSTALLATION) |
56 void InstallMissingPlugin(PluginInstaller* installer, | 54 void InstallMissingPlugin(PluginInstaller* installer, |
57 const PluginMetadata* plugin_metadata); | 55 const PluginMetadata* plugin_metadata); |
(...skipping 17 matching lines...) Expand all Loading... |
75 // Stores all PluginPlaceholderHosts, keyed by their routing ID. | 73 // Stores all PluginPlaceholderHosts, keyed by their routing ID. |
76 std::map<int, PluginPlaceholderHost*> plugin_placeholders_; | 74 std::map<int, PluginPlaceholderHost*> plugin_placeholders_; |
77 #endif | 75 #endif |
78 | 76 |
79 base::WeakPtrFactory<PluginObserver> weak_ptr_factory_; | 77 base::WeakPtrFactory<PluginObserver> weak_ptr_factory_; |
80 | 78 |
81 DISALLOW_COPY_AND_ASSIGN(PluginObserver); | 79 DISALLOW_COPY_AND_ASSIGN(PluginObserver); |
82 }; | 80 }; |
83 | 81 |
84 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_ | 82 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_ |
OLD | NEW |