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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/prerender/prerender_final_status.h" | 16 #include "chrome/browser/prerender/prerender_final_status.h" |
17 #include "content/browser/tab_contents/tab_contents_observer.h" | 17 #include "content/browser/tab_contents/tab_contents_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 | 19 |
20 class Profile; | 20 class Profile; |
21 class RenderViewHost; | 21 class RenderViewHost; |
22 class RenderViewHostDelegate; | 22 class RenderViewHostDelegate; |
23 class SessionStorageNamespace; | 23 class SessionStorageNamespace; |
24 class TabContents; | 24 class TabContents; |
25 class TabContentsWrapper; | 25 class TabContentsWrapper; |
26 struct FaviconURL; | 26 struct FaviconURL; |
27 struct ViewHostMsg_FrameNavigate_Params; | |
28 | 27 |
29 namespace base { | 28 namespace base { |
30 class ProcessMetrics; | 29 class ProcessMetrics; |
31 } | 30 } |
32 | 31 |
33 namespace prerender { | 32 namespace prerender { |
34 | 33 |
35 class PrerenderManager; | 34 class PrerenderManager; |
36 class PrerenderRenderViewHostObserver; | 35 class PrerenderRenderViewHostObserver; |
37 class PrerenderTracker; | 36 class PrerenderTracker; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 virtual void StartPrerendering( | 86 virtual void StartPrerendering( |
88 const RenderViewHost* source_render_view_host, | 87 const RenderViewHost* source_render_view_host, |
89 SessionStorageNamespace* session_storage_namespace); | 88 SessionStorageNamespace* session_storage_namespace); |
90 | 89 |
91 // Verifies that the prerendering is not using too many resources, and kills | 90 // Verifies that the prerendering is not using too many resources, and kills |
92 // it if not. | 91 // it if not. |
93 void DestroyWhenUsingTooManyResources(); | 92 void DestroyWhenUsingTooManyResources(); |
94 | 93 |
95 RenderViewHost* render_view_host_mutable(); | 94 RenderViewHost* render_view_host_mutable(); |
96 const RenderViewHost* render_view_host() const; | 95 const RenderViewHost* render_view_host() const; |
97 | |
98 ViewHostMsg_FrameNavigate_Params* navigate_params() { | |
99 return navigate_params_.get(); | |
100 } | |
101 string16 title() const { return title_; } | 96 string16 title() const { return title_; } |
102 int32 page_id() const { return page_id_; } | 97 int32 page_id() const { return page_id_; } |
103 GURL icon_url() const { return icon_url_; } | 98 GURL icon_url() const { return icon_url_; } |
104 const GURL& prerender_url() const { return prerender_url_; } | 99 const GURL& prerender_url() const { return prerender_url_; } |
105 const GURL& referrer() const { return referrer_; } | 100 const GURL& referrer() const { return referrer_; } |
106 bool has_stopped_loading() const { return has_stopped_loading_; } | 101 bool has_stopped_loading() const { return has_stopped_loading_; } |
107 bool prerendering_has_started() const { return prerendering_has_started_; } | 102 bool prerendering_has_started() const { return prerendering_has_started_; } |
108 | 103 |
109 // Sets the parameter to the value of the associated RenderViewHost's child id | 104 // Sets the parameter to the value of the associated RenderViewHost's child id |
110 // and returns a boolean indicating the validity of that id. | 105 // and returns a boolean indicating the validity of that id. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 231 |
237 // The prerender tracker tracking prerenders. | 232 // The prerender tracker tracking prerenders. |
238 PrerenderTracker* prerender_tracker_; | 233 PrerenderTracker* prerender_tracker_; |
239 | 234 |
240 // The URL being prerendered. | 235 // The URL being prerendered. |
241 GURL prerender_url_; | 236 GURL prerender_url_; |
242 | 237 |
243 // The referrer. | 238 // The referrer. |
244 GURL referrer_; | 239 GURL referrer_; |
245 | 240 |
246 // The NavigationParameters of the finished navigation. | |
247 scoped_ptr<ViewHostMsg_FrameNavigate_Params> navigate_params_; | |
248 | |
249 // The profile being used | 241 // The profile being used |
250 Profile* profile_; | 242 Profile* profile_; |
251 | 243 |
252 // Information about the title and URL of the page that this class as a | 244 // Information about the title and URL of the page that this class as a |
253 // RenderViewHostDelegate has received from the RenderView. | 245 // RenderViewHostDelegate has received from the RenderView. |
254 // Used to apply to the new RenderViewHost delegate that might eventually | 246 // Used to apply to the new RenderViewHost delegate that might eventually |
255 // own the contained RenderViewHost when the prerendered page is shown | 247 // own the contained RenderViewHost when the prerendered page is shown |
256 // in a TabContents. | 248 // in a TabContents. |
257 string16 title_; | 249 string16 title_; |
258 int32 page_id_; | 250 int32 page_id_; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 303 |
312 // Offset by which to offset prerendered pages | 304 // Offset by which to offset prerendered pages |
313 static const int32 kPrerenderPageIdOffset = 10; | 305 static const int32 kPrerenderPageIdOffset = 10; |
314 | 306 |
315 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 307 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
316 }; | 308 }; |
317 | 309 |
318 } // namespace prerender | 310 } // namespace prerender |
319 | 311 |
320 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 312 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |