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_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 ViewHostMsg_FrameNavigate_Params* p = pc->navigate_params(); | 331 ViewHostMsg_FrameNavigate_Params* p = pc->navigate_params(); |
332 if (p != NULL) | 332 if (p != NULL) |
333 tc->DidNavigate(rvh, *p); | 333 tc->DidNavigate(rvh, *p); |
334 | 334 |
335 string16 title = pc->title(); | 335 string16 title = pc->title(); |
336 if (!title.empty()) | 336 if (!title.empty()) |
337 tc->UpdateTitle(rvh, pc->page_id(), UTF16ToWideHack(title)); | 337 tc->UpdateTitle(rvh, pc->page_id(), UTF16ToWideHack(title)); |
338 | 338 |
339 GURL icon_url = pc->icon_url(); | 339 GURL icon_url = pc->icon_url(); |
340 if (!icon_url.is_empty()) | 340 if (!icon_url.is_empty()) { |
341 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), icon_url); | 341 LOG(INFO) << "MaybeUsePreloadedPage"; |
| 342 std::vector<FaviconURL> urls; |
| 343 urls.push_back(FaviconURL(icon_url, FAVICON)); |
| 344 tc->favicon_helper().OnUpdateFaviconURL(pc->page_id(), urls); |
| 345 } |
342 | 346 |
343 if (pc->has_stopped_loading()) | 347 if (pc->has_stopped_loading()) |
344 tc->DidStopLoading(); | 348 tc->DidStopLoading(); |
345 | 349 |
346 return true; | 350 return true; |
347 } | 351 } |
348 | 352 |
349 void PrerenderManager::RemoveEntry(PrerenderContents* entry) { | 353 void PrerenderManager::RemoveEntry(PrerenderContents* entry) { |
350 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 354 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
351 for (std::list<PrerenderContentsData>::iterator it = prerender_list_.begin(); | 355 for (std::list<PrerenderContentsData>::iterator it = prerender_list_.begin(); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 | 597 |
594 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const { | 598 bool PrerenderManager::IsTabContentsPrerendered(TabContents* tc) const { |
595 return prerendered_tc_set_.count(tc) > 0; | 599 return prerendered_tc_set_.count(tc) > 0; |
596 } | 600 } |
597 | 601 |
598 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const { | 602 bool PrerenderManager::WouldTabContentsBePrerendered(TabContents* tc) const { |
599 return would_be_prerendered_tc_set_.count(tc) > 0; | 603 return would_be_prerendered_tc_set_.count(tc) > 0; |
600 } | 604 } |
601 | 605 |
602 } // namespace prerender | 606 } // namespace prerender |
OLD | NEW |