OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 29 matching lines...) Expand all Loading... |
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 // Checks with the PrerenderManager if the specified URL has been preloaded, | |
51 // and if so, swap the RenderViewHost with the preload into this TabContents | |
52 // object. |opener_url| denotes the window.opener url that is set for this | |
53 // tab and is empty if there is no opener set. | |
54 bool MaybeUsePrerenderedPage(const GURL& url, const GURL& opener_url); | |
55 | |
56 // Returns whether the TabContents being observed is currently prerendering. | 50 // Returns whether the TabContents being observed is currently prerendering. |
57 bool IsPrerendering(); | 51 bool IsPrerendering(); |
58 | 52 |
59 // Records histogram information for the current hover, based on whether | 53 // Records histogram information for the current hover, based on whether |
60 // 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. |
61 // Also resets the hover to no hover. | 55 // Also resets the hover to no hover. |
62 void MaybeLogCurrentHover(bool was_used); | 56 void MaybeLogCurrentHover(bool was_used); |
63 | 57 |
64 bool IsTopSite(const GURL& url); | 58 bool IsTopSite(const GURL& url); |
65 | 59 |
(...skipping 13 matching lines...) Expand all Loading... |
79 | 73 |
80 // Current URL being loaded. | 74 // Current URL being loaded. |
81 GURL url_; | 75 GURL url_; |
82 | 76 |
83 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper); | 77 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper); |
84 }; | 78 }; |
85 | 79 |
86 } // namespace prerender | 80 } // namespace prerender |
87 | 81 |
88 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ | 82 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ |
OLD | NEW |