OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ |
7 | 7 |
8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void DidStartNavigation( | 91 void DidStartNavigation( |
92 content::NavigationHandle* navigation_handle) override; | 92 content::NavigationHandle* navigation_handle) override; |
93 void DidRedirectNavigation( | 93 void DidRedirectNavigation( |
94 content::NavigationHandle* navigation_handle) override; | 94 content::NavigationHandle* navigation_handle) override; |
95 void DidFinishNavigation( | 95 void DidFinishNavigation( |
96 content::NavigationHandle* navigation_handle) override; | 96 content::NavigationHandle* navigation_handle) override; |
97 void DidGetResourceResponseStart( | 97 void DidGetResourceResponseStart( |
98 const content::ResourceRequestDetails& details) override; | 98 const content::ResourceRequestDetails& details) override; |
99 void DidGetUserInteraction(const blink::WebInputEvent::Type type) override; | 99 void DidGetUserInteraction(const blink::WebInputEvent::Type type) override; |
100 void WebContentsDestroyed() override; | 100 void WebContentsDestroyed() override; |
| 101 void DidOpenRequestedURL(content::WebContents* new_contents, |
| 102 content::RenderFrameHost* source_render_frame_host, |
| 103 const GURL& url, |
| 104 const content::Referrer& referrer, |
| 105 WindowOpenDisposition disposition, |
| 106 ui::PageTransition transition, |
| 107 bool started_from_context_menu, |
| 108 bool renderer_initiated) override; |
101 | 109 |
102 // Map keyed on NavigationHandle* to keep track of all the ongoing navigation | 110 // Map keyed on NavigationHandle* to keep track of all the ongoing navigation |
103 // events. NavigationHandle pointers are owned by RenderFrameHost. Since a | 111 // events. NavigationHandle pointers are owned by RenderFrameHost. Since a |
104 // NavigationHandle object will be destructed after navigation is done, | 112 // NavigationHandle object will be destructed after navigation is done, |
105 // at the end of DidFinishNavigation(...) corresponding entries in this map | 113 // at the end of DidFinishNavigation(...) corresponding entries in this map |
106 // will be removed from navigation_handle_map_ and added to | 114 // will be removed from navigation_handle_map_ and added to |
107 // SafeBrowsingNavigationObserverManager::navigation_map_. | 115 // SafeBrowsingNavigationObserverManager::navigation_map_. |
108 NavigationHandleMap navigation_handle_map_; | 116 NavigationHandleMap navigation_handle_map_; |
109 | 117 |
110 scoped_refptr<SafeBrowsingNavigationObserverManager> manager_; | 118 scoped_refptr<SafeBrowsingNavigationObserverManager> manager_; |
111 | 119 |
112 // If the observed WebContents just got an user gesture. | 120 // If the observed WebContents just got an user gesture. |
113 bool has_user_gesture_; | 121 bool has_user_gesture_; |
114 | 122 |
115 base::Time last_user_gesture_timestamp_; | 123 base::Time last_user_gesture_timestamp_; |
116 | 124 |
117 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingNavigationObserver); | 125 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingNavigationObserver); |
118 }; | 126 }; |
119 | 127 |
120 } // namespace safe_browsing | 128 } // namespace safe_browsing |
121 | 129 |
122 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ | 130 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ |
OLD | NEW |