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 "base/time.h" | 8 #include "base/time.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 const GURL& url, | 28 const GURL& url, |
29 const GURL& opener_url) OVERRIDE; | 29 const GURL& opener_url) OVERRIDE; |
30 virtual void DidStopLoading() OVERRIDE; | 30 virtual void DidStopLoading() OVERRIDE; |
31 virtual void DidStartProvisionalLoadForFrame( | 31 virtual void DidStartProvisionalLoadForFrame( |
32 int64 frame_id, | 32 int64 frame_id, |
33 bool is_main_frame, | 33 bool is_main_frame, |
34 const GURL& validated_url, | 34 const GURL& validated_url, |
35 bool is_error_page, | 35 bool is_error_page, |
36 content::RenderViewHost* render_view_host) OVERRIDE; | 36 content::RenderViewHost* render_view_host) OVERRIDE; |
37 | 37 |
38 // Called when this prerendered TabContents has just been swapped in. | 38 // Called when this prerendered WebContents has just been swapped in. |
39 void PrerenderSwappedIn(); | 39 void PrerenderSwappedIn(); |
40 | 40 |
41 void UpdateTargetURL(int32 page_id, const GURL& url); | 41 void UpdateTargetURL(int32 page_id, const GURL& url); |
42 | 42 |
43 private: | 43 private: |
44 // The data we store for a hover (time the hover occurred & URL). | 44 // The data we store for a hover (time the hover occurred & URL). |
45 class HoverData; | 45 class HoverData; |
46 | 46 |
47 // Retrieves the PrerenderManager, or NULL, if none was found. | 47 // Retrieves the PrerenderManager, or NULL, if none was found. |
48 PrerenderManager* MaybeGetPrerenderManager() const; | 48 PrerenderManager* MaybeGetPrerenderManager() const; |
49 | 49 |
50 // Returns whether the TabContents being observed is currently prerendering. | 50 // Returns whether the WebContents being observed is currently prerendering. |
51 bool IsPrerendering(); | 51 bool IsPrerendering(); |
52 | 52 |
53 // Records histogram information for the current hover, based on whether | 53 // Records histogram information for the current hover, based on whether |
54 // it was used or not. Will not do anything if there is no current hover. | 54 // it was used or not. Will not do anything if there is no current hover. |
55 // Also resets the hover to no hover. | 55 // Also resets the hover to no hover. |
56 void MaybeLogCurrentHover(bool was_used); | 56 void MaybeLogCurrentHover(bool was_used); |
57 | 57 |
58 bool IsTopSite(const GURL& url); | 58 bool IsTopSite(const GURL& url); |
59 | 59 |
60 // TabContentsWrapper we're created for. | 60 // TabContentsWrapper we're created for. |
(...skipping 17 matching lines...) Expand all Loading... |
78 | 78 |
79 // Current URL being loaded. | 79 // Current URL being loaded. |
80 GURL url_; | 80 GURL url_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper); | 82 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace prerender | 85 } // namespace prerender |
86 | 86 |
87 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ | 87 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ |
OLD | NEW |