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" | |
27 #include "content/public/browser/web_contents_observer.h" | 26 #include "content/public/browser/web_contents_observer.h" |
28 #include "content/public/common/referrer.h" | 27 #include "content/public/common/referrer.h" |
29 #include "mojo/public/cpp/bindings/binding.h" | 28 #include "mojo/public/cpp/bindings/binding.h" |
30 #include "services/service_manager/public/cpp/bind_source_info.h" | 29 #include "services/service_manager/public/cpp/bind_source_info.h" |
31 #include "ui/gfx/geometry/rect.h" | 30 #include "ui/gfx/geometry/rect.h" |
32 | 31 |
33 class Profile; | 32 class Profile; |
34 | 33 |
35 namespace base { | 34 namespace base { |
36 class ProcessMetrics; | 35 class ProcessMetrics; |
37 } | 36 } |
38 | 37 |
39 namespace content { | 38 namespace content { |
40 class RenderViewHost; | 39 class RenderViewHost; |
41 class SessionStorageNamespace; | 40 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, | |
285 content::SessionStorageNamespace* session_storage_namespace); | 284 content::SessionStorageNamespace* session_storage_namespace); |
286 | 285 |
287 PrerenderMode prerender_mode_; | 286 PrerenderMode prerender_mode_; |
288 bool prerendering_has_started_; | 287 bool prerendering_has_started_; |
289 | 288 |
290 // Time at which we started to load the URL. This is used to compute | 289 // Time at which we started to load the URL. This is used to compute |
291 // the time elapsed from initiating a prerender until the time the | 290 // the time elapsed from initiating a prerender until the time the |
292 // (potentially only partially) prerendered page is shown to the user. | 291 // (potentially only partially) prerendered page is shown to the user. |
293 base::TimeTicks load_start_time_; | 292 base::TimeTicks load_start_time_; |
294 | 293 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 int64_t network_bytes_; | 388 int64_t network_bytes_; |
390 | 389 |
391 base::WeakPtrFactory<PrerenderContents> weak_factory_; | 390 base::WeakPtrFactory<PrerenderContents> weak_factory_; |
392 | 391 |
393 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 392 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
394 }; | 393 }; |
395 | 394 |
396 } // namespace prerender | 395 } // namespace prerender |
397 | 396 |
398 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 397 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |