| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "chrome/browser/prerender/prerender_final_status.h" | 14 #include "chrome/browser/prerender/prerender_final_status.h" |
| 15 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 15 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
| 16 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 16 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
| 17 #include "chrome/common/icon_messages.h" | 17 #include "chrome/common/icon_messages.h" |
| 18 #include "chrome/common/prerender_constants.h" | |
| 19 #include "chrome/common/view_types.h" | 18 #include "chrome/common/view_types.h" |
| 20 #include "content/browser/renderer_host/render_view_host_delegate.h" | 19 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 21 #include "content/common/notification_registrar.h" | 20 #include "content/common/notification_registrar.h" |
| 22 #include "content/common/window_container_type.h" | 21 #include "content/common/window_container_type.h" |
| 23 #include "webkit/glue/window_open_disposition.h" | 22 #include "webkit/glue/window_open_disposition.h" |
| 24 | 23 |
| 25 class TabContents; | 24 class TabContents; |
| 26 struct WebPreferences; | 25 struct WebPreferences; |
| 27 struct ViewHostMsg_FrameNavigate_Params; | 26 struct ViewHostMsg_FrameNavigate_Params; |
| 28 | 27 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 const GURL& prerender_url() const { return prerender_url_; } | 200 const GURL& prerender_url() const { return prerender_url_; } |
| 202 | 201 |
| 203 private: | 202 private: |
| 204 // Needs to be able to call the constructor. | 203 // Needs to be able to call the constructor. |
| 205 friend class PrerenderContentsFactoryImpl; | 204 friend class PrerenderContentsFactoryImpl; |
| 206 | 205 |
| 207 // Message handlers. | 206 // Message handlers. |
| 208 void OnDidStartProvisionalLoadForFrame(int64 frame_id, | 207 void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
| 209 bool main_frame, | 208 bool main_frame, |
| 210 const GURL& url); | 209 const GURL& url); |
| 211 | |
| 212 void OnUpdateFaviconURL(int32 page_id, const std::vector<FaviconURL>& urls); | 210 void OnUpdateFaviconURL(int32 page_id, const std::vector<FaviconURL>& urls); |
| 213 | 211 void OnMaybeCancelPrerenderForHTML5Media(); |
| 214 void OnMaybeCancelPrerender(PrerenderCancellationReason reason); | |
| 215 | 212 |
| 216 // Adds an alias URL, for one of the many redirections. Returns whether | 213 // Adds an alias URL, for one of the many redirections. Returns whether |
| 217 // the URL is valid. | 214 // the URL is valid. |
| 218 bool AddAliasURL(const GURL& url); | 215 bool AddAliasURL(const GURL& url); |
| 219 | 216 |
| 220 // Remove |this| from the PrerenderManager, set a final status, and | 217 // Remove |this| from the PrerenderManager, set a final status, and |
| 221 // delete |this|. | 218 // delete |this|. |
| 222 void Destroy(FinalStatus reason); | 219 void Destroy(FinalStatus reason); |
| 223 | 220 |
| 224 // Returns the ProcessMetrics for the render process, if it exists. | 221 // Returns the ProcessMetrics for the render process, if it exists. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // Maximum amount of private memory that may be used per PrerenderContents, | 276 // Maximum amount of private memory that may be used per PrerenderContents, |
| 280 // in MB. | 277 // in MB. |
| 281 static const int kMaxPrerenderPrivateMB = 100; | 278 static const int kMaxPrerenderPrivateMB = 100; |
| 282 | 279 |
| 283 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 280 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| 284 }; | 281 }; |
| 285 | 282 |
| 286 } // prerender | 283 } // prerender |
| 287 | 284 |
| 288 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 285 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| OLD | NEW |