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

Unified Diff: chrome/browser/infobars/infobar_service.h

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 | « no previous file | chrome/browser/infobars/infobar_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/infobars/infobar_service.h
diff --git a/chrome/browser/infobars/infobar_service.h b/chrome/browser/infobars/infobar_service.h
index d502b58f1905d6ec36c0ee065a2e00325954876a..9468eb45d1f798b15b72184fc2091d760eaa5188 100644
--- a/chrome/browser/infobars/infobar_service.h
+++ b/chrome/browser/infobars/infobar_service.h
@@ -37,6 +37,14 @@ class InfoBarService : public infobars::InfoBarManager,
static content::WebContents* WebContentsFromInfoBar(
infobars::InfoBar* infobar);
+ // Makes it so the next reload is ignored. That is, if the next commit is a
+ // reload then it is treated as if nothing happened and no infobars are
+ // attempted to be closed.
+ // This is useful for non-user triggered reloads that should not dismiss
+ // infobars. For example, instant may trigger a reload when the google URL
+ // changes.
+ void set_ignore_next_reload() { ignore_next_reload_ = true; }
+
private:
friend class content::WebContentsUserData<InfoBarService>;
@@ -53,6 +61,9 @@ class InfoBarService : public infobars::InfoBarManager,
// content::WebContentsObserver:
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
+ virtual void DidStartNavigationToPendingEntry(
+ const GURL& url,
+ content::NavigationController::ReloadType reload_type) OVERRIDE;
virtual void NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) OVERRIDE;
virtual void WebContentsDestroyed() OVERRIDE;
@@ -62,6 +73,8 @@ class InfoBarService : public infobars::InfoBarManager,
void OnDidBlockDisplayingInsecureContent();
void OnDidBlockRunningInsecureContent();
+ // See description in set_ignore_next_reload().
+ bool ignore_next_reload_;
DISALLOW_COPY_AND_ASSIGN(InfoBarService);
};
« no previous file with comments | « no previous file | chrome/browser/infobars/infobar_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698