| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PRERENDER_PRERENDER_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class PrerenderTabHelper | 25 class PrerenderTabHelper |
| 26 : public content::WebContentsObserver, | 26 : public content::WebContentsObserver, |
| 27 public content::WebContentsUserData<PrerenderTabHelper> { | 27 public content::WebContentsUserData<PrerenderTabHelper> { |
| 28 public: | 28 public: |
| 29 ~PrerenderTabHelper() override; | 29 ~PrerenderTabHelper() override; |
| 30 | 30 |
| 31 // content::WebContentsObserver implementation. | 31 // content::WebContentsObserver implementation. |
| 32 void DidGetRedirectForResourceRequest( | 32 void DidGetRedirectForResourceRequest( |
| 33 const content::ResourceRedirectDetails& details) override; | 33 const content::ResourceRedirectDetails& details) override; |
| 34 void DidStopLoading() override; | 34 void DidStopLoading() override; |
| 35 void DidStartProvisionalLoadForFrame( | 35 void DidStartNavigation( |
| 36 content::RenderFrameHost* render_frame_host, | 36 content::NavigationHandle* navigation_handle) override; |
| 37 const GURL& validated_url, | 37 void DidFinishNavigation( |
| 38 bool is_error_page) override; | 38 content::NavigationHandle* navigation_handle) override; |
| 39 void DidCommitProvisionalLoadForFrame( | |
| 40 content::RenderFrameHost* render_frame_host, | |
| 41 const GURL& validated_url, | |
| 42 ui::PageTransition transition_type) override; | |
| 43 | 39 |
| 44 // Called when the URL of the main frame changed, either when the load | 40 // Called when the URL of the main frame changed, either when the load |
| 45 // commits, or a redirect happens. | 41 // commits, or a redirect happens. |
| 46 void MainFrameUrlDidChange(const GURL& url); | 42 void MainFrameUrlDidChange(const GURL& url); |
| 47 | 43 |
| 48 // Called when this prerendered WebContents has just been swapped in. | 44 // Called when this prerendered WebContents has just been swapped in. |
| 49 void PrerenderSwappedIn(); | 45 void PrerenderSwappedIn(); |
| 50 | 46 |
| 51 base::TimeTicks swap_ticks() const { return swap_ticks_; } | 47 base::TimeTicks swap_ticks() const { return swap_ticks_; } |
| 52 | 48 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 GURL url_; | 94 GURL url_; |
| 99 | 95 |
| 100 base::WeakPtrFactory<PrerenderTabHelper> weak_factory_; | 96 base::WeakPtrFactory<PrerenderTabHelper> weak_factory_; |
| 101 | 97 |
| 102 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper); | 98 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper); |
| 103 }; | 99 }; |
| 104 | 100 |
| 105 } // namespace prerender | 101 } // namespace prerender |
| 106 | 102 |
| 107 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ | 103 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ |
| OLD | NEW |