| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/background_contents_service.h" | 8 #include "chrome/browser/background_contents_service.h" |
| 9 #include "chrome/browser/browsing_instance.h" | 9 #include "chrome/browser/browsing_instance.h" |
| 10 #include "chrome/browser/prerender/prerender_manager.h" | 10 #include "chrome/browser/prerender/prerender_manager.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 PrerenderContents::PrerenderContents(PrerenderManager* prerender_manager, | 32 PrerenderContents::PrerenderContents(PrerenderManager* prerender_manager, |
| 33 Profile* profile, | 33 Profile* profile, |
| 34 const GURL& url, | 34 const GURL& url, |
| 35 const std::vector<GURL>& alias_urls) | 35 const std::vector<GURL>& alias_urls) |
| 36 : prerender_manager_(prerender_manager), | 36 : prerender_manager_(prerender_manager), |
| 37 render_view_host_(NULL), | 37 render_view_host_(NULL), |
| 38 prerender_url_(url), | 38 prerender_url_(url), |
| 39 profile_(profile), | 39 profile_(profile), |
| 40 page_id_(0) { | 40 page_id_(0), |
| 41 has_stopped_loading_(false) { |
| 41 DCHECK(prerender_manager != NULL); | 42 DCHECK(prerender_manager != NULL); |
| 42 AddAliasURL(prerender_url_); | 43 AddAliasURL(prerender_url_); |
| 43 for (std::vector<GURL>::const_iterator it = alias_urls.begin(); | 44 for (std::vector<GURL>::const_iterator it = alias_urls.begin(); |
| 44 it != alias_urls.end(); | 45 it != alias_urls.end(); |
| 45 ++it) { | 46 ++it) { |
| 46 AddAliasURL(*it); | 47 AddAliasURL(*it); |
| 47 } | 48 } |
| 48 } | 49 } |
| 49 | 50 |
| 50 // static | 51 // static |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 273 } |
| 273 | 274 |
| 274 void PrerenderContents::AddAliasURL(const GURL& url) { | 275 void PrerenderContents::AddAliasURL(const GURL& url) { |
| 275 alias_urls_.push_back(url); | 276 alias_urls_.push_back(url); |
| 276 } | 277 } |
| 277 | 278 |
| 278 bool PrerenderContents::MatchesURL(const GURL& url) const { | 279 bool PrerenderContents::MatchesURL(const GURL& url) const { |
| 279 return std::find(alias_urls_.begin(), alias_urls_.end(), url) | 280 return std::find(alias_urls_.begin(), alias_urls_.end(), url) |
| 280 != alias_urls_.end(); | 281 != alias_urls_.end(); |
| 281 } | 282 } |
| 283 |
| 284 void PrerenderContents::DidStopLoading() { |
| 285 has_stopped_loading_ = true; |
| 286 } |
| OLD | NEW |