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