Chromium Code Reviews| 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_; |