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_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // - Hide the infobar if the plugin starts responding again. | 33 // - Hide the infobar if the plugin starts responding again. |
34 // - Keep track of all of this for any number of plugins. | 34 // - Keep track of all of this for any number of plugins. |
35 class HungPluginTabHelper | 35 class HungPluginTabHelper |
36 : public content::WebContentsObserver, | 36 : public content::WebContentsObserver, |
37 public content::NotificationObserver, | 37 public content::NotificationObserver, |
38 public content::WebContentsUserData<HungPluginTabHelper> { | 38 public content::WebContentsUserData<HungPluginTabHelper> { |
39 public: | 39 public: |
40 virtual ~HungPluginTabHelper(); | 40 virtual ~HungPluginTabHelper(); |
41 | 41 |
42 // content::WebContentsObserver overrides: | 42 // content::WebContentsObserver overrides: |
43 virtual void PluginCrashed(const FilePath& plugin_path) OVERRIDE; | 43 virtual void PluginCrashed(const FilePath& plugin_path, |
| 44 base::ProcessId plugin_pid) OVERRIDE; |
44 virtual void PluginHungStatusChanged(int plugin_child_id, | 45 virtual void PluginHungStatusChanged(int plugin_child_id, |
45 const FilePath& plugin_path, | 46 const FilePath& plugin_path, |
46 bool is_hung) OVERRIDE; | 47 bool is_hung) OVERRIDE; |
47 | 48 |
48 // NotificationObserver overrides. | 49 // NotificationObserver overrides. |
49 virtual void Observe(int type, | 50 virtual void Observe(int type, |
50 const content::NotificationSource& source, | 51 const content::NotificationSource& source, |
51 const content::NotificationDetails& details) OVERRIDE; | 52 const content::NotificationDetails& details) OVERRIDE; |
52 | 53 |
53 // Called by an infobar when the user selects to kill the plugin. | 54 // Called by an infobar when the user selects to kill the plugin. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 100 |
100 content::NotificationRegistrar registrar_; | 101 content::NotificationRegistrar registrar_; |
101 | 102 |
102 // All currently hung plugins. | 103 // All currently hung plugins. |
103 PluginStateMap hung_plugins_; | 104 PluginStateMap hung_plugins_; |
104 | 105 |
105 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); | 106 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); |
106 }; | 107 }; |
107 | 108 |
108 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 109 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
OLD | NEW |