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_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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 RenderViewHost* render_view_host_mutable(); | 99 RenderViewHost* render_view_host_mutable(); |
100 const RenderViewHost* render_view_host() const; | 100 const RenderViewHost* render_view_host() const; |
101 | 101 |
102 ViewHostMsg_FrameNavigate_Params* navigate_params() { | 102 ViewHostMsg_FrameNavigate_Params* navigate_params() { |
103 return navigate_params_.get(); | 103 return navigate_params_.get(); |
104 } | 104 } |
105 string16 title() const { return title_; } | 105 string16 title() const { return title_; } |
106 int32 page_id() const { return page_id_; } | 106 int32 page_id() const { return page_id_; } |
107 GURL icon_url() const { return icon_url_; } | 107 GURL icon_url() const { return icon_url_; } |
108 const GURL& prerender_url() const { return prerender_url_; } | 108 const GURL& prerender_url() const { return prerender_url_; } |
109 const GURL& referrer() const { return referrer_; } | |
110 bool has_stopped_loading() const { return has_stopped_loading_; } | 109 bool has_stopped_loading() const { return has_stopped_loading_; } |
111 bool prerendering_has_started() const { return prerendering_has_started_; } | 110 bool prerendering_has_started() const { return prerendering_has_started_; } |
112 | 111 |
113 // Sets the parameter to the value of the associated RenderViewHost's child id | 112 // Sets the parameter to the value of the associated RenderViewHost's child id |
114 // and returns a boolean indicating the validity of that id. | 113 // and returns a boolean indicating the validity of that id. |
115 virtual bool GetChildId(int* child_id) const; | 114 virtual bool GetChildId(int* child_id) const; |
116 | 115 |
117 // Sets the parameter to the value of the associated RenderViewHost's route id | 116 // Sets the parameter to the value of the associated RenderViewHost's route id |
118 // and returns a boolean indicating the validity of that id. | 117 // and returns a boolean indicating the validity of that id. |
119 virtual bool GetRouteId(int* route_id) const; | 118 virtual bool GetRouteId(int* route_id) const; |
120 | 119 |
121 // Set the final status for how the PrerenderContents was used. This | 120 // Set the final status for how the PrerenderContents was used. This |
122 // should only be called once, and should be called before the prerender | 121 // should only be called once, and should be called before the prerender |
123 // contents are destroyed. | 122 // contents are destroyed. |
124 void set_final_status(FinalStatus final_status); | 123 void set_final_status(FinalStatus final_status); |
125 FinalStatus final_status() const { return final_status_; } | 124 FinalStatus final_status() const { return final_status_; } |
126 | 125 |
127 Origin origin() const { return origin_; } | 126 Origin origin() const { return origin_; } |
128 uint8 experiment_id() const { return experiment_id_; } | |
129 | 127 |
130 base::TimeTicks load_start_time() const { return load_start_time_; } | 128 base::TimeTicks load_start_time() const { return load_start_time_; } |
131 | 129 |
132 // Indicates whether this prerendered page can be used for the provided | 130 // Indicates whether this prerendered page can be used for the provided |
133 // URL, i.e. whether there is a match. |matching_url| is optional and will be | 131 // URL, i.e. whether there is a match. |matching_url| is optional and will be |
134 // set to the URL that is found as a match if it is provided. | 132 // set to the URL that is found as a match if it is provided. |
135 bool MatchesURL(const GURL& url, GURL* matching_url) const; | 133 bool MatchesURL(const GURL& url, GURL* matching_url) const; |
136 | 134 |
137 void OnJSOutOfMemory(); | 135 void OnJSOutOfMemory(); |
138 bool ShouldSuppressDialogs(); | 136 bool ShouldSuppressDialogs(); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 310 |
313 // Offset by which to offset prerendered pages | 311 // Offset by which to offset prerendered pages |
314 static const int32 kPrerenderPageIdOffset = 10; | 312 static const int32 kPrerenderPageIdOffset = 10; |
315 | 313 |
316 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 314 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
317 }; | 315 }; |
318 | 316 |
319 } // namespace prerender | 317 } // namespace prerender |
320 | 318 |
321 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 319 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |