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_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 void DestroyWhenUsingTooManyResources(); | 115 void DestroyWhenUsingTooManyResources(); |
116 | 116 |
117 RenderViewHost* render_view_host_mutable(); | 117 RenderViewHost* render_view_host_mutable(); |
118 const RenderViewHost* render_view_host() const; | 118 const RenderViewHost* render_view_host() const; |
119 string16 title() const { return title_; } | 119 string16 title() const { return title_; } |
120 int32 page_id() const { return page_id_; } | 120 int32 page_id() const { return page_id_; } |
121 GURL icon_url() const { return icon_url_; } | 121 GURL icon_url() const { return icon_url_; } |
122 const GURL& prerender_url() const { return prerender_url_; } | 122 const GURL& prerender_url() const { return prerender_url_; } |
123 const content::Referrer& referrer() const { return referrer_; } | 123 const content::Referrer& referrer() const { return referrer_; } |
124 bool has_stopped_loading() const { return has_stopped_loading_; } | 124 bool has_stopped_loading() const { return has_stopped_loading_; } |
| 125 bool has_finished_loading() const { return has_finished_loading_; } |
125 bool prerendering_has_started() const { return prerendering_has_started_; } | 126 bool prerendering_has_started() const { return prerendering_has_started_; } |
126 MatchCompleteStatus match_complete_status() const { | 127 MatchCompleteStatus match_complete_status() const { |
127 return match_complete_status_; | 128 return match_complete_status_; |
128 } | 129 } |
129 void set_match_complete_status(MatchCompleteStatus status) { | 130 void set_match_complete_status(MatchCompleteStatus status) { |
130 match_complete_status_ = status; | 131 match_complete_status_ = status; |
131 } | 132 } |
132 | 133 |
133 // Sets the parameter to the value of the associated RenderViewHost's child id | 134 // Sets the parameter to the value of the associated RenderViewHost's child id |
134 // and returns a boolean indicating the validity of that id. | 135 // and returns a boolean indicating the validity of that id. |
(...skipping 23 matching lines...) Expand all Loading... |
158 bool ShouldSuppressDialogs(); | 159 bool ShouldSuppressDialogs(); |
159 | 160 |
160 // content::WebContentsObserver implementation. | 161 // content::WebContentsObserver implementation. |
161 virtual void DidStopLoading() OVERRIDE; | 162 virtual void DidStopLoading() OVERRIDE; |
162 virtual void DidStartProvisionalLoadForFrame( | 163 virtual void DidStartProvisionalLoadForFrame( |
163 int64 frame_id, | 164 int64 frame_id, |
164 bool is_main_frame, | 165 bool is_main_frame, |
165 const GURL& validated_url, | 166 const GURL& validated_url, |
166 bool is_error_page, | 167 bool is_error_page, |
167 RenderViewHost* render_view_host) OVERRIDE; | 168 RenderViewHost* render_view_host) OVERRIDE; |
| 169 virtual void DidFinishLoad(int64 frame_id, |
| 170 const GURL& validated_url, |
| 171 bool is_main_frame) OVERRIDE; |
| 172 |
168 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 173 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
169 | 174 |
170 // content::NotificationObserver | 175 // content::NotificationObserver |
171 virtual void Observe(int type, | 176 virtual void Observe(int type, |
172 const content::NotificationSource& source, | 177 const content::NotificationSource& source, |
173 const content::NotificationDetails& details) OVERRIDE; | 178 const content::NotificationDetails& details) OVERRIDE; |
174 | 179 |
175 // Adds an alias URL, for one of the many redirections. If the URL can not | 180 // Adds an alias URL, for one of the many redirections. If the URL can not |
176 // be prerendered - for example, it's an ftp URL - |this| will be destroyed | 181 // be prerendered - for example, it's an ftp URL - |this| will be destroyed |
177 // and false is returned. Otherwise, true is returned and the alias is | 182 // and false is returned. Otherwise, true is returned and the alias is |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 GURL icon_url_; | 284 GURL icon_url_; |
280 content::NotificationRegistrar notification_registrar_; | 285 content::NotificationRegistrar notification_registrar_; |
281 | 286 |
282 // A vector of URLs that this prerendered page matches against. | 287 // A vector of URLs that this prerendered page matches against. |
283 // This array can contain more than element as a result of redirects, | 288 // This array can contain more than element as a result of redirects, |
284 // such as HTTP redirects or javascript redirects. | 289 // such as HTTP redirects or javascript redirects. |
285 std::vector<GURL> alias_urls_; | 290 std::vector<GURL> alias_urls_; |
286 | 291 |
287 bool has_stopped_loading_; | 292 bool has_stopped_loading_; |
288 | 293 |
| 294 // True when the main frame has finished loading. |
| 295 bool has_finished_loading_; |
| 296 |
289 // This must be the same value as the PrerenderTracker has recorded for | 297 // This must be the same value as the PrerenderTracker has recorded for |
290 // |this|, when |this| has a RenderView. | 298 // |this|, when |this| has a RenderView. |
291 FinalStatus final_status_; | 299 FinalStatus final_status_; |
292 | 300 |
293 bool prerendering_has_started_; | 301 bool prerendering_has_started_; |
294 | 302 |
295 // The MatchComplete status of the prerender, indicating how it relates | 303 // The MatchComplete status of the prerender, indicating how it relates |
296 // to being a MatchComplete dummy (see definition of MatchCompleteStatus | 304 // to being a MatchComplete dummy (see definition of MatchCompleteStatus |
297 // above). | 305 // above). |
298 MatchCompleteStatus match_complete_status_; | 306 MatchCompleteStatus match_complete_status_; |
(...skipping 30 matching lines...) Expand all Loading... |
329 | 337 |
330 // List of all pages the prerendered page has tried to prerender. | 338 // List of all pages the prerendered page has tried to prerender. |
331 PendingPrerenderList pending_prerender_list_; | 339 PendingPrerenderList pending_prerender_list_; |
332 | 340 |
333 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 341 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
334 }; | 342 }; |
335 | 343 |
336 } // namespace prerender | 344 } // namespace prerender |
337 | 345 |
338 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 346 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |