Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: chrome/browser/ui/hung_plugin_tab_helper.cc

Issue 211273007: Split InfoBarService core code into InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/hung_plugin_tab_helper.cc
diff --git a/chrome/browser/ui/hung_plugin_tab_helper.cc b/chrome/browser/ui/hung_plugin_tab_helper.cc
index 229f0442b0784c36f933076a0a12c1087214b7d9..5907a6c765b04b3fb12d9640e48901852d515ec3 100644
--- a/chrome/browser/ui/hung_plugin_tab_helper.cc
+++ b/chrome/browser/ui/hung_plugin_tab_helper.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
+#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
@@ -278,13 +279,14 @@ void HungPluginTabHelper::PluginCrashed(const base::FilePath& plugin_path,
if (!infobar_service)
return;
+ InfoBarManager* infobar_manager = infobar_service->infobar_manager();
// For now, just do a brute-force search to see if we have this plugin. Since
// we'll normally have 0 or 1, this is fast.
for (PluginStateMap::iterator i = hung_plugins_.begin();
i != hung_plugins_.end(); ++i) {
if (i->second->path == plugin_path) {
if (i->second->infobar)
- infobar_service->RemoveInfoBar(i->second->infobar);
+ infobar_manager->RemoveInfoBar(i->second->infobar);
hung_plugins_.erase(i);
break;
}
@@ -300,12 +302,13 @@ void HungPluginTabHelper::PluginHungStatusChanged(
if (!infobar_service)
return;
+ InfoBarManager* infobar_manager = infobar_service->infobar_manager();
PluginStateMap::iterator found = hung_plugins_.find(plugin_child_id);
if (found != hung_plugins_.end()) {
if (!is_hung) {
// Hung plugin became un-hung, close the infobar and delete our info.
if (found->second->infobar)
- infobar_service->RemoveInfoBar(found->second->infobar);
+ infobar_manager->RemoveInfoBar(found->second->infobar);
hung_plugins_.erase(found);
}
return;
@@ -416,7 +419,7 @@ void HungPluginTabHelper::CloseBar(PluginState* state) {
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents());
if (infobar_service && state->infobar) {
- infobar_service->RemoveInfoBar(state->infobar);
+ infobar_service->infobar_manager()->RemoveInfoBar(state->infobar);
state->infobar = NULL;
}
}
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698