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 #include "chrome/browser/prerender/prerender_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/background_contents_service.h" | 9 #include "chrome/browser/background_contents_service.h" |
10 #include "chrome/browser/browsing_instance.h" | 10 #include "chrome/browser/browsing_instance.h" |
11 #include "chrome/browser/prerender/prerender_manager.h" | 11 #include "chrome/browser/prerender/prerender_manager.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/renderer_host/render_view_host.h" | 13 #include "chrome/browser/renderer_host/render_view_host.h" |
14 #include "chrome/browser/renderer_host/site_instance.h" | 14 #include "chrome/browser/renderer_host/site_instance.h" |
15 #include "chrome/browser/renderer_preferences_util.h" | 15 #include "chrome/browser/renderer_preferences_util.h" |
16 #include "chrome/common/extensions/extension_constants.h" | 16 #include "chrome/common/extensions/extension_constants.h" |
17 #include "chrome/common/notification_service.h" | 17 #include "chrome/common/notification_service.h" |
18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
19 #include "chrome/common/view_types.h" | 19 #include "chrome/common/view_types.h" |
20 #include "chrome/common/render_messages.h" | 20 #include "chrome/common/render_messages.h" |
21 #include "chrome/common/render_messages_params.h" | 21 #include "chrome/common/render_messages_params.h" |
22 #include "gfx/rect.h" | 22 #include "ui/gfx/rect.h" |
23 | 23 |
24 class PrerenderContentsFactoryImpl : public PrerenderContents::Factory { | 24 class PrerenderContentsFactoryImpl : public PrerenderContents::Factory { |
25 public: | 25 public: |
26 virtual PrerenderContents* CreatePrerenderContents( | 26 virtual PrerenderContents* CreatePrerenderContents( |
27 PrerenderManager* prerender_manager, Profile* profile, const GURL& url, | 27 PrerenderManager* prerender_manager, Profile* profile, const GURL& url, |
28 const std::vector<GURL>& alias_urls) { | 28 const std::vector<GURL>& alias_urls) { |
29 return new PrerenderContents(prerender_manager, profile, url, alias_urls); | 29 return new PrerenderContents(prerender_manager, profile, url, alias_urls); |
30 } | 30 } |
31 }; | 31 }; |
32 | 32 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 306 |
307 void PrerenderContents::DidStopLoading() { | 307 void PrerenderContents::DidStopLoading() { |
308 has_stopped_loading_ = true; | 308 has_stopped_loading_ = true; |
309 } | 309 } |
310 | 310 |
311 void PrerenderContents::Destroy(FinalStatus final_status) { | 311 void PrerenderContents::Destroy(FinalStatus final_status) { |
312 prerender_manager_->RemoveEntry(this); | 312 prerender_manager_->RemoveEntry(this); |
313 set_final_status(final_status); | 313 set_final_status(final_status); |
314 delete this; | 314 delete this; |
315 } | 315 } |
OLD | NEW |