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

Unified Diff: content/browser/tab_contents/navigation_entry.cc

Issue 8224023: Don't show URL for pending new navigations initiated by the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsBrowserInitiated helper. Created 9 years, 2 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: content/browser/tab_contents/navigation_entry.cc
diff --git a/content/browser/tab_contents/navigation_entry.cc b/content/browser/tab_contents/navigation_entry.cc
index 5d71d00484102952c2e3427d6a5fb3445fa94b36..d98916016de834698ec1d297e839bce0721ab4b9 100644
--- a/content/browser/tab_contents/navigation_entry.cc
+++ b/content/browser/tab_contents/navigation_entry.cc
@@ -105,3 +105,11 @@ const string16& NavigationEntry::GetTitleForDisplay(
bool NavigationEntry::IsViewSourceMode() const {
return virtual_url_.SchemeIs(chrome::kViewSourceScheme);
}
+
+bool NavigationEntry::IsBrowserInitiated() const {
+ // Most PageTransition types are browser initiated. LINK and FORM_SUBMIT
+ // indicate it was a renderer-initiated navigation.
+ return transition_type_ != PageTransition::LINK &&
+ transition_type_ != PageTransition::FORM_SUBMIT;
+}
+

Powered by Google App Engine
This is Rietveld 408576698