Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: chrome/browser/prerender/prerender_manager.cc

Issue 11411180: move favicon download code from chrome/ into content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WebContentsObserver and callback Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/prerender/prerender_manager.h" 5 #include "chrome/browser/prerender/prerender_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 // Merge the browsing history. 444 // Merge the browsing history.
445 new_tab_contents->web_contents()->GetController().CopyStateFromAndPrune( 445 new_tab_contents->web_contents()->GetController().CopyStateFromAndPrune(
446 &old_tab_contents->web_contents()->GetController()); 446 &old_tab_contents->web_contents()->GetController());
447 CoreTabHelper::FromWebContents(old_tab_contents->web_contents())->delegate()-> 447 CoreTabHelper::FromWebContents(old_tab_contents->web_contents())->delegate()->
448 SwapTabContents(old_tab_contents->web_contents(), 448 SwapTabContents(old_tab_contents->web_contents(),
449 new_tab_contents->web_contents()); 449 new_tab_contents->web_contents());
450 prerender_contents->CommitHistory(new_tab_contents); 450 prerender_contents->CommitHistory(new_tab_contents);
451 451
452 GURL icon_url = prerender_contents->icon_url(); 452 GURL icon_url = prerender_contents->icon_url();
453 if (!icon_url.is_empty()) { 453 if (!icon_url.is_empty()) {
454 std::vector<FaviconURL> urls; 454 std::vector<content::FaviconURL> urls;
455 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON)); 455 urls.push_back(content::FaviconURL(icon_url, content::FaviconURL::FAVICON));
456 FaviconTabHelper::FromWebContents(new_tab_contents->web_contents())-> 456 FaviconTabHelper::FromWebContents(new_tab_contents->web_contents())->
457 OnUpdateFaviconURL(prerender_contents->page_id(), urls); 457 DidUpdateFaviconURL(prerender_contents->page_id(), urls);
458 } 458 }
459 459
460 // Update PPLT metrics: 460 // Update PPLT metrics:
461 // If the tab has finished loading, record a PPLT of 0. 461 // If the tab has finished loading, record a PPLT of 0.
462 // If the tab is still loading, reset its start time to the current time. 462 // If the tab is still loading, reset its start time to the current time.
463 PrerenderTabHelper* prerender_tab_helper = 463 PrerenderTabHelper* prerender_tab_helper =
464 PrerenderTabHelper::FromWebContents(new_tab_contents->web_contents()); 464 PrerenderTabHelper::FromWebContents(new_tab_contents->web_contents());
465 DCHECK(prerender_tab_helper != NULL); 465 DCHECK(prerender_tab_helper != NULL);
466 prerender_tab_helper->PrerenderSwappedIn(); 466 prerender_tab_helper->PrerenderSwappedIn();
467 467
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 if (!render_process_host || !render_process_host->GetBrowserContext()) 1342 if (!render_process_host || !render_process_host->GetBrowserContext())
1343 return NULL; 1343 return NULL;
1344 Profile* profile = Profile::FromBrowserContext( 1344 Profile* profile = Profile::FromBrowserContext(
1345 render_process_host->GetBrowserContext()); 1345 render_process_host->GetBrowserContext());
1346 if (!profile) 1346 if (!profile)
1347 return NULL; 1347 return NULL;
1348 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); 1348 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile);
1349 } 1349 }
1350 1350
1351 } // namespace prerender 1351 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698