| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 const FilePath& plugin_path, | 44 const FilePath& plugin_path, |
| 45 bool is_hung) OVERRIDE; | 45 bool is_hung) OVERRIDE; |
| 46 | 46 |
| 47 // NotificationObserver overrides. | 47 // NotificationObserver overrides. |
| 48 virtual void Observe(int type, | 48 virtual void Observe(int type, |
| 49 const content::NotificationSource& source, | 49 const content::NotificationSource& source, |
| 50 const content::NotificationDetails& details) OVERRIDE; | 50 const content::NotificationDetails& details) OVERRIDE; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 explicit HungPluginTabHelper(content::WebContents* contents); | 53 explicit HungPluginTabHelper(content::WebContents* contents); |
| 54 static int kUserDataKey; | |
| 55 friend class WebContentsUserData<HungPluginTabHelper>; | 54 friend class WebContentsUserData<HungPluginTabHelper>; |
| 56 | 55 |
| 57 class InfoBarDelegate; | 56 class InfoBarDelegate; |
| 58 friend class InfoBarDelegate; | 57 friend class InfoBarDelegate; |
| 59 | 58 |
| 60 // Per-plugin state (since there could be more than one plugin hung). The | 59 // Per-plugin state (since there could be more than one plugin hung). The |
| 61 // integer key is the child process ID of the plugin process. This maintains | 60 // integer key is the child process ID of the plugin process. This maintains |
| 62 // the state for all plugins on this page that are currently hung, whether or | 61 // the state for all plugins on this page that are currently hung, whether or |
| 63 // not we're currently showing the infobar. | 62 // not we're currently showing the infobar. |
| 64 struct PluginState { | 63 struct PluginState { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 104 |
| 106 content::NotificationRegistrar registrar_; | 105 content::NotificationRegistrar registrar_; |
| 107 | 106 |
| 108 // All currently hung plugins. | 107 // All currently hung plugins. |
| 109 PluginStateMap hung_plugins_; | 108 PluginStateMap hung_plugins_; |
| 110 | 109 |
| 111 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); | 110 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 113 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
| OLD | NEW |