| 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/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
| 18 #include "content/public/browser/web_contents_user_data.h" | 18 #include "content/public/browser/web_contents_user_data.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class FilePath; | 21 class FilePath; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace infobars { | |
| 25 class InfoBarDelegate; | |
| 26 } | |
| 27 | |
| 28 // Manages per-tab state with regard to hung plugins. This only handles | 24 // Manages per-tab state with regard to hung plugins. This only handles |
| 29 // Pepper plugins which we know are windowless. Hung NPAPI plugins (which | 25 // Pepper plugins which we know are windowless. Hung NPAPI plugins (which |
| 30 // may have native windows) can not be handled with infobars and have a | 26 // may have native windows) can not be handled with infobars and have a |
| 31 // separate OS-specific hang monitoring. | 27 // separate OS-specific hang monitoring. |
| 32 // | 28 // |
| 33 // Our job is: | 29 // Our job is: |
| 34 // - Pop up an infobar when a plugin is hung. | 30 // - Pop up an infobar when a plugin is hung. |
| 35 // - Terminate the plugin process if the user so chooses. | 31 // - Terminate the plugin process if the user so chooses. |
| 36 // - Periodically re-show the hung plugin infobar if the user closes it without | 32 // - Periodically re-show the hung plugin infobar if the user closes it without |
| 37 // terminating the plugin. | 33 // terminating the plugin. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 76 |
| 81 content::NotificationRegistrar registrar_; | 77 content::NotificationRegistrar registrar_; |
| 82 | 78 |
| 83 // All currently hung plugins. | 79 // All currently hung plugins. |
| 84 PluginStateMap hung_plugins_; | 80 PluginStateMap hung_plugins_; |
| 85 | 81 |
| 86 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); | 82 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); |
| 87 }; | 83 }; |
| 88 | 84 |
| 89 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 85 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
| OLD | NEW |