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 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <utility> | 12 #include <utility> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "chrome/browser/prerender/prerender_final_status.h" | 20 #include "chrome/browser/prerender/prerender_final_status.h" |
21 #include "chrome/browser/prerender/prerender_origin.h" | 21 #include "chrome/browser/prerender/prerender_origin.h" |
22 #include "chrome/common/prerender.mojom.h" | 22 #include "chrome/common/prerender.mojom.h" |
23 #include "chrome/common/prerender_types.h" | 23 #include "chrome/common/prerender_types.h" |
24 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
25 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
| 26 #include "content/public/browser/web_contents.h" |
26 #include "content/public/browser/web_contents_observer.h" | 27 #include "content/public/browser/web_contents_observer.h" |
27 #include "content/public/common/referrer.h" | 28 #include "content/public/common/referrer.h" |
28 #include "mojo/public/cpp/bindings/binding.h" | 29 #include "mojo/public/cpp/bindings/binding.h" |
29 #include "services/service_manager/public/cpp/bind_source_info.h" | 30 #include "services/service_manager/public/cpp/bind_source_info.h" |
30 #include "ui/gfx/geometry/rect.h" | 31 #include "ui/gfx/geometry/rect.h" |
31 | 32 |
32 class Profile; | 33 class Profile; |
33 | 34 |
34 namespace base { | 35 namespace base { |
35 class ProcessMetrics; | 36 class ProcessMetrics; |
36 } | 37 } |
37 | 38 |
38 namespace content { | 39 namespace content { |
39 class RenderViewHost; | 40 class RenderViewHost; |
40 class SessionStorageNamespace; | 41 class SessionStorageNamespace; |
41 class WebContents; | |
42 } | 42 } |
43 | 43 |
44 namespace history { | 44 namespace history { |
45 struct HistoryAddPageArgs; | 45 struct HistoryAddPageArgs; |
46 } | 46 } |
47 | 47 |
48 namespace prerender { | 48 namespace prerender { |
49 | 49 |
50 class PrerenderManager; | 50 class PrerenderManager; |
51 class PrerenderResourceThrottle; | 51 class PrerenderResourceThrottle; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Called whenever a RenderViewHost is created for prerendering. Only called | 274 // Called whenever a RenderViewHost is created for prerendering. Only called |
275 // once the RenderViewHost has a RenderView and RenderWidgetHostView. | 275 // once the RenderViewHost has a RenderView and RenderWidgetHostView. |
276 virtual void OnRenderViewHostCreated( | 276 virtual void OnRenderViewHostCreated( |
277 content::RenderViewHost* new_render_view_host); | 277 content::RenderViewHost* new_render_view_host); |
278 | 278 |
279 content::NotificationRegistrar& notification_registrar() { | 279 content::NotificationRegistrar& notification_registrar() { |
280 return notification_registrar_; | 280 return notification_registrar_; |
281 } | 281 } |
282 | 282 |
283 content::WebContents* CreateWebContents( | 283 content::WebContents* CreateWebContents( |
| 284 const content::WebContents::CreateParams& create_params, |
284 content::SessionStorageNamespace* session_storage_namespace); | 285 content::SessionStorageNamespace* session_storage_namespace); |
285 | 286 |
286 PrerenderMode prerender_mode_; | 287 PrerenderMode prerender_mode_; |
287 bool prerendering_has_started_; | 288 bool prerendering_has_started_; |
288 | 289 |
289 // Time at which we started to load the URL. This is used to compute | 290 // Time at which we started to load the URL. This is used to compute |
290 // the time elapsed from initiating a prerender until the time the | 291 // the time elapsed from initiating a prerender until the time the |
291 // (potentially only partially) prerendered page is shown to the user. | 292 // (potentially only partially) prerendered page is shown to the user. |
292 base::TimeTicks load_start_time_; | 293 base::TimeTicks load_start_time_; |
293 | 294 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 int64_t network_bytes_; | 389 int64_t network_bytes_; |
389 | 390 |
390 base::WeakPtrFactory<PrerenderContents> weak_factory_; | 391 base::WeakPtrFactory<PrerenderContents> weak_factory_; |
391 | 392 |
392 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 393 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
393 }; | 394 }; |
394 | 395 |
395 } // namespace prerender | 396 } // namespace prerender |
396 | 397 |
397 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 398 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |