| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 : timestamp(timestamp), ip(ip) {} | 57 : timestamp(timestamp), ip(ip) {} |
| 58 base::Time timestamp; // Timestamp of when we get the resolved IP. | 58 base::Time timestamp; // Timestamp of when we get the resolved IP. |
| 59 std::string ip; // Resolved IP address | 59 std::string ip; // Resolved IP address |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // Observes the navigation events for a single WebContents (both main-frame | 62 // Observes the navigation events for a single WebContents (both main-frame |
| 63 // and sub-frame navigations). | 63 // and sub-frame navigations). |
| 64 class SafeBrowsingNavigationObserver : public base::SupportsUserData::Data, | 64 class SafeBrowsingNavigationObserver : public base::SupportsUserData::Data, |
| 65 public content::WebContentsObserver { | 65 public content::WebContentsObserver { |
| 66 public: | 66 public: |
| 67 static void MaybeCreateForWebContents(content::WebContents* web_contents); | 67 static void MaybeCreateForWebContents( |
| 68 content::WebContents* web_contents); |
| 69 |
| 68 static SafeBrowsingNavigationObserver* FromWebContents( | 70 static SafeBrowsingNavigationObserver* FromWebContents( |
| 69 content::WebContents* web_contents); | 71 content::WebContents* web_contents); |
| 70 | 72 |
| 71 SafeBrowsingNavigationObserver( | 73 SafeBrowsingNavigationObserver( |
| 72 content::WebContents* contents, | 74 content::WebContents* contents, |
| 73 const scoped_refptr<SafeBrowsingNavigationObserverManager>& manager); | 75 const scoped_refptr<SafeBrowsingNavigationObserverManager>& manager); |
| 74 | 76 |
| 75 ~SafeBrowsingNavigationObserver() override; | 77 ~SafeBrowsingNavigationObserver() override; |
| 76 | 78 |
| 77 private: | 79 private: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 104 bool has_user_gesture_; | 106 bool has_user_gesture_; |
| 105 | 107 |
| 106 base::Time last_user_gesture_timestamp_; | 108 base::Time last_user_gesture_timestamp_; |
| 107 | 109 |
| 108 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingNavigationObserver); | 110 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingNavigationObserver); |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 } // namespace safe_browsing | 113 } // namespace safe_browsing |
| 112 | 114 |
| 113 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ | 115 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_H_ |
| OLD | NEW |