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

Unified Diff: content/browser/tab_contents/navigation_details.h

Issue 7324001: Revert 89864 - Don't rely on user gestures for deciding when to dismiss infobars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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_details.h
===================================================================
--- content/browser/tab_contents/navigation_details.h (revision 91739)
+++ content/browser/tab_contents/navigation_details.h (working copy)
@@ -37,8 +37,16 @@
// The previous URL that the user was on. This may be empty if none.
GURL previous_url;
+ // True when this load was non-user initated. This corresponds to a
+ // a NavigationGestureAuto call from WebKit (see webview_delegate.h).
+ // We also count reloads and meta-refreshes as "auto" to account for the
+ // fact that WebKit doesn't always set the user gesture properly in these
+ // cases (see bug 1051891).
+ bool is_auto;
+
// True if the committed entry has replaced the exisiting one.
// A non-user initiated redirect causes such replacement.
+ // This is somewhat similiar to is_auto, but not exactly the same.
bool did_replace_entry;
// True if the navigation was in-page. This means that the active entry's
@@ -55,11 +63,12 @@
// Use SSLManager::DeserializeSecurityInfo to decode it.
std::string serialized_security_info;
- // Returns whether the main frame navigated to a different page (e.g., not
- // scrolling to a fragment inside the current page). We often need this logic
- // for showing or hiding something.
- bool is_navigation_to_different_page() const {
- return is_main_frame && !is_in_page;
+ // Returns whether the user probably felt like they navigated somewhere new.
+ // We often need this logic for showing or hiding something, and this
+ // returns true only for main frame loads that the user initiated, that go
+ // to a new page.
+ bool is_user_initiated_main_frame_load() const {
+ return !is_auto && !is_in_page && is_main_frame;
}
// The HTTP status code for this entry..
« no previous file with comments | « content/browser/tab_contents/navigation_controller_unittest.cc ('k') | content/browser/tab_contents/navigation_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698