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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 3436002: Add the onBeforeNavigate and onErrorOccured events to the webNavigation API. (Closed)
Patch Set: updates Created 10 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/tab_contents/provisional_load_details.cc ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 67428cef80370f154a8dc03f6a316acfd2dfdaed..1d702bd78ae465c94d40eed541af3c0ef99f9b3b 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2452,6 +2452,30 @@ void TabContents::DidNavigate(RenderViewHost* rvh,
bool did_navigate = controller_.RendererDidNavigate(
params, extra_invalidate_flags, &details);
+ // Send notification about committed provisional loads. This notification is
+ // different from the NAV_ENTRY_COMMITTED notification which doesn't include
+ // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations.
+ if (details.type != NavigationType::NAV_IGNORE) {
+ ProvisionalLoadDetails load_details(details.is_main_frame,
+ details.is_in_page,
+ params.url, std::string(), false);
+ load_details.set_transition_type(params.transition);
+ // Whether or not a page transition was triggered by going backward or
+ // forward in the history is only stored in the navigation controller's
+ // entry list.
+ if (did_navigate &&
+ (controller_.GetActiveEntry()->transition_type() &
+ PageTransition::FORWARD_BACK)) {
+ load_details.set_transition_type(
+ params.transition | PageTransition::FORWARD_BACK);
+ }
+ NotificationService::current()->Notify(
+ NotificationType::FRAME_PROVISIONAL_LOAD_COMMITTED,
+ Source<NavigationController>(&controller_),
+ Details<ProvisionalLoadDetails>(&load_details));
+
+ }
+
// Update history. Note that this needs to happen after the entry is complete,
// which WillNavigate[Main,Sub]Frame will do before this function is called.
if (params.should_update_history) {
« no previous file with comments | « chrome/browser/tab_contents/provisional_load_details.cc ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698