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

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

Issue 2545133002: PlzNavigate: Fix ordering of onBeforeNavigate and onCreatedNavigationTarget. (Closed)
Patch Set: 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..f3ec0e027db92ba7b00e7cfc516c978a408cadfc 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 DispatchOnBeforeNavigate();
Devlin 2016/12/02 20:17:11 nit: Can we rename this to be DispatchPendingOnBef
nasko 2016/12/02 21:40:45 Acknowledged.
+
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