| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_NET_PREDICTOR_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_NET_PREDICTOR_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_NET_PREDICTOR_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_NET_PREDICTOR_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 #include "content/public/browser/web_contents_user_data.h" | 12 #include "content/public/browser/web_contents_user_data.h" |
| 13 | 13 |
| 14 namespace content { | |
| 15 class NavigationHandle; | |
| 16 } | |
| 17 | |
| 18 namespace chrome_browser_net { | 14 namespace chrome_browser_net { |
| 19 | 15 |
| 20 class PredictorTabHelper | 16 class PredictorTabHelper |
| 21 : public content::WebContentsObserver, | 17 : public content::WebContentsObserver, |
| 22 public content::WebContentsUserData<PredictorTabHelper> { | 18 public content::WebContentsUserData<PredictorTabHelper> { |
| 23 public: | 19 public: |
| 24 ~PredictorTabHelper() override; | 20 ~PredictorTabHelper() override; |
| 25 | 21 |
| 26 // content::WebContentsObserver: | 22 // content::WebContentsObserver implementation |
| 27 void DidStartNavigation( | |
| 28 content::NavigationHandle* navigation_handle) override; | |
| 29 void DidStartNavigationToPendingEntry( | 23 void DidStartNavigationToPendingEntry( |
| 30 const GURL& url, | 24 const GURL& url, |
| 31 content::NavigationController::ReloadType reload_type) override; | 25 content::NavigationController::ReloadType reload_type) override; |
| 32 | 26 |
| 33 private: | 27 private: |
| 34 explicit PredictorTabHelper(content::WebContents* web_contents); | 28 explicit PredictorTabHelper(content::WebContents* web_contents); |
| 35 friend class content::WebContentsUserData<PredictorTabHelper>; | 29 friend class content::WebContentsUserData<PredictorTabHelper>; |
| 36 | 30 |
| 37 void PreconnectUrl(const GURL& url); | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(PredictorTabHelper); | 31 DISALLOW_COPY_AND_ASSIGN(PredictorTabHelper); |
| 40 }; | 32 }; |
| 41 | 33 |
| 42 } // namespace chrome_browser_net | 34 } // namespace chrome_browser_net |
| 43 | 35 |
| 44 #endif // CHROME_BROWSER_NET_PREDICTOR_TAB_HELPER_H_ | 36 #endif // CHROME_BROWSER_NET_PREDICTOR_TAB_HELPER_H_ |
| OLD | NEW |