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

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

Issue 553333006: Makes InfoBarService not close infobars on a reload from browser instant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 6 years, 3 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
« no previous file with comments | « chrome/browser/infobars/infobar_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index 2a5f283c771182b0b1b5d1622e15e6bc80d15413..0a54dd37453f5737bbe80370e5502fb6a3fe1e51 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/browser_instant_controller.h"
#include "base/bind.h"
+#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/instant_service.h"
#include "chrome/browser/search/instant_service_factory.h"
@@ -160,6 +161,13 @@ void BrowserInstantController::DefaultSearchProviderChanged() {
// renderer.
if (!instant_service->IsInstantProcess(rph->GetID()))
continue;
+
contents->GetController().Reload(false);
+
+ // As the reload was not triggered by the user we don't want to close any
+ // infobars. We have to tell the InfoBarService after the reload, otherwise
+ // it would ignore this call when
+ // WebContentsObserver::DidStartNavigationToPendingEntry is invoked.
+ InfoBarService::FromWebContents(contents)->set_ignore_next_reload();
}
}
« no previous file with comments | « chrome/browser/infobars/infobar_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698