| 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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/prerender/prerender_final_status.h" | 17 #include "chrome/browser/prerender/prerender_final_status.h" |
| 18 #include "chrome/browser/prerender/prerender_origin.h" | 18 #include "chrome/browser/prerender/prerender_origin.h" |
| 19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 21 #include "content/public/browser/web_contents_observer.h" | 21 #include "content/public/browser/web_contents_observer.h" |
| 22 #include "content/public/common/referrer.h" | 22 #include "content/public/common/referrer.h" |
| 23 #include "ui/gfx/size.h" | 23 #include "ui/gfx/size.h" |
| 24 | 24 |
| 25 class Profile; | 25 class Profile; |
| 26 class TabContents; | 26 class TabContents; |
| 27 struct FaviconURL; | |
| 28 | 27 |
| 29 namespace base { | 28 namespace base { |
| 30 class ProcessMetrics; | 29 class ProcessMetrics; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace content { | 32 namespace content { |
| 33 struct FaviconURL; |
| 34 class RenderViewHost; | 34 class RenderViewHost; |
| 35 class SessionStorageNamespace; | 35 class SessionStorageNamespace; |
| 36 class WebContents; | 36 class WebContents; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace history { | 39 namespace history { |
| 40 struct HistoryAddPageArgs; | 40 struct HistoryAddPageArgs; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace prerender { | 43 namespace prerender { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 int64 parent_frame_id, | 195 int64 parent_frame_id, |
| 196 bool is_main_frame, | 196 bool is_main_frame, |
| 197 const GURL& validated_url, | 197 const GURL& validated_url, |
| 198 bool is_error_page, | 198 bool is_error_page, |
| 199 content::RenderViewHost* render_view_host) OVERRIDE; | 199 content::RenderViewHost* render_view_host) OVERRIDE; |
| 200 virtual void DidFinishLoad( | 200 virtual void DidFinishLoad( |
| 201 int64 frame_id, | 201 int64 frame_id, |
| 202 const GURL& validated_url, | 202 const GURL& validated_url, |
| 203 bool is_main_frame, | 203 bool is_main_frame, |
| 204 content::RenderViewHost* render_view_host) OVERRIDE; | 204 content::RenderViewHost* render_view_host) OVERRIDE; |
| 205 virtual void DidUpdateFaviconURL(int32 page_id, |
| 206 const std::vector<content::FaviconURL>& urls) OVERRIDE; |
| 205 | 207 |
| 206 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 208 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 207 | 209 |
| 208 // content::NotificationObserver | 210 // content::NotificationObserver |
| 209 virtual void Observe(int type, | 211 virtual void Observe(int type, |
| 210 const content::NotificationSource& source, | 212 const content::NotificationSource& source, |
| 211 const content::NotificationDetails& details) OVERRIDE; | 213 const content::NotificationDetails& details) OVERRIDE; |
| 212 | 214 |
| 213 // Adds an alias URL, for one of the many redirections. If the URL can not | 215 // Adds an alias URL, for one of the many redirections. If the URL can not |
| 214 // be prerendered - for example, it's an ftp URL - |this| will be destroyed | 216 // be prerendered - for example, it's an ftp URL - |this| will be destroyed |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 base::TimeTicks load_start_time_; | 289 base::TimeTicks load_start_time_; |
| 288 | 290 |
| 289 private: | 291 private: |
| 290 class TabContentsDelegateImpl; | 292 class TabContentsDelegateImpl; |
| 291 | 293 |
| 292 // Needs to be able to call the constructor. | 294 // Needs to be able to call the constructor. |
| 293 friend class PrerenderContentsFactoryImpl; | 295 friend class PrerenderContentsFactoryImpl; |
| 294 | 296 |
| 295 friend class PrerenderRenderViewHostObserver; | 297 friend class PrerenderRenderViewHostObserver; |
| 296 | 298 |
| 297 // Message handlers. | |
| 298 void OnUpdateFaviconURL(int32 page_id, const std::vector<FaviconURL>& urls); | |
| 299 | |
| 300 // Returns the RenderViewHost Delegate for this prerender. | 299 // Returns the RenderViewHost Delegate for this prerender. |
| 301 content::WebContents* GetWebContents(); | 300 content::WebContents* GetWebContents(); |
| 302 | 301 |
| 303 // Returns the ProcessMetrics for the render process, if it exists. | 302 // Returns the ProcessMetrics for the render process, if it exists. |
| 304 base::ProcessMetrics* MaybeGetProcessMetrics(); | 303 base::ProcessMetrics* MaybeGetProcessMetrics(); |
| 305 | 304 |
| 306 // The prerender manager owning this object. | 305 // The prerender manager owning this object. |
| 307 PrerenderManager* prerender_manager_; | 306 PrerenderManager* prerender_manager_; |
| 308 | 307 |
| 309 // The prerender tracker tracking prerenders. | 308 // The prerender tracker tracking prerenders. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 | 391 |
| 393 // Caches pages to be added to the history. | 392 // Caches pages to be added to the history. |
| 394 AddPageVector add_page_vector_; | 393 AddPageVector add_page_vector_; |
| 395 | 394 |
| 396 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 395 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| 397 }; | 396 }; |
| 398 | 397 |
| 399 } // namespace prerender | 398 } // namespace prerender |
| 400 | 399 |
| 401 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 400 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| OLD | NEW |