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

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.h

Issue 2545133002: PlzNavigate: Fix ordering of onBeforeNavigate and onCreatedNavigationTarget. (Closed)
Patch Set: Another round of review fixes. Created 4 years 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: chrome/browser/extensions/api/web_navigation/web_navigation_api.h
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
index 47a2915470d4df2f34b45667434d48565723c80e..c663e68fb58ebd86a4e56a06cd6ff47510787e3e 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
@@ -71,6 +71,9 @@ class WebNavigationTabObserver
ui::PageTransition transition) override;
void WebContentsDestroyed() override;
+ // This method dispatches the already created onBeforeNavigate event.
+ void DispatchCachedOnBeforeNavigate();
+
private:
explicit WebNavigationTabObserver(content::WebContents* web_contents);
friend class content::WebContentsUserData<WebNavigationTabObserver>;
@@ -95,6 +98,11 @@ class WebNavigationTabObserver
// Tracks the state of the frames we are sending events for.
FrameNavigationState navigation_state_;
+ // The latest onBeforeNavigate event this frame has generated. It is stored
+ // as it might not be sent immediately, but delayed until the tab is added to
+ // the tab strip and is ready to dispatch events.
+ std::unique_ptr<Event> pending_on_before_navigate_event_;
+
// Used for tracking registrations to redirect notifications.
content::NotificationRegistrar registrar_;

Powered by Google App Engine
This is Rietveld 408576698