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_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 static void SetMode(PrerenderManagerMode mode); | 162 static void SetMode(PrerenderManagerMode mode); |
163 static bool IsPrerenderingPossible(); | 163 static bool IsPrerenderingPossible(); |
164 static bool ActuallyPrerendering(); | 164 static bool ActuallyPrerendering(); |
165 static bool IsControlGroup(); | 165 static bool IsControlGroup(); |
166 static bool IsNoUseGroup(); | 166 static bool IsNoUseGroup(); |
167 | 167 |
168 // Query the list of current prerender pages to see if the given web contents | 168 // Query the list of current prerender pages to see if the given web contents |
169 // is prerendering a page. | 169 // is prerendering a page. |
170 bool IsWebContentsPrerendering(content::WebContents* web_contents) const; | 170 bool IsWebContentsPrerendering(content::WebContents* web_contents) const; |
171 | 171 |
| 172 // Returns true if there is a prerendered page for the given URL and it has |
| 173 // finished loading. Only valid if called before MaybeUsePrerenderedPage. |
| 174 bool DidPrerenderFinishLoading(const GURL& url) const; |
| 175 |
172 // Maintaining and querying the set of WebContents belonging to this | 176 // Maintaining and querying the set of WebContents belonging to this |
173 // PrerenderManager that are currently showing prerendered pages. | 177 // PrerenderManager that are currently showing prerendered pages. |
174 void MarkWebContentsAsPrerendered(content::WebContents* web_contents); | 178 void MarkWebContentsAsPrerendered(content::WebContents* web_contents); |
175 void MarkWebContentsAsWouldBePrerendered(content::WebContents* web_contents); | 179 void MarkWebContentsAsWouldBePrerendered(content::WebContents* web_contents); |
176 void MarkWebContentsAsNotPrerendered(content::WebContents* web_contents); | 180 void MarkWebContentsAsNotPrerendered(content::WebContents* web_contents); |
177 bool IsWebContentsPrerendered(content::WebContents* web_contents) const; | 181 bool IsWebContentsPrerendered(content::WebContents* web_contents) const; |
178 bool WouldWebContentsBePrerendered(content::WebContents* web_contents) const; | 182 bool WouldWebContentsBePrerendered(content::WebContents* web_contents) const; |
179 bool IsOldRenderViewHost(const RenderViewHost* render_view_host) const; | 183 bool IsOldRenderViewHost(const RenderViewHost* render_view_host) const; |
180 | 184 |
181 // Checks whether navigation to the provided URL has occurred in a visible | 185 // Checks whether navigation to the provided URL has occurred in a visible |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 451 |
448 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 452 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
449 }; | 453 }; |
450 | 454 |
451 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( | 455 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( |
452 int render_process_id); | 456 int render_process_id); |
453 | 457 |
454 } // namespace prerender | 458 } // namespace prerender |
455 | 459 |
456 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 460 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |