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

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

Issue 10905301: Switch CoreTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 months 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 prerender_contents->ReleasePrerenderContents(); 395 prerender_contents->ReleasePrerenderContents();
396 TabContents* old_tab_contents = TabContents::FromWebContents(web_contents); 396 TabContents* old_tab_contents = TabContents::FromWebContents(web_contents);
397 DCHECK(new_tab_contents); 397 DCHECK(new_tab_contents);
398 DCHECK(old_tab_contents); 398 DCHECK(old_tab_contents);
399 399
400 MarkWebContentsAsPrerendered(new_tab_contents->web_contents()); 400 MarkWebContentsAsPrerendered(new_tab_contents->web_contents());
401 401
402 // Merge the browsing history. 402 // Merge the browsing history.
403 new_tab_contents->web_contents()->GetController().CopyStateFromAndPrune( 403 new_tab_contents->web_contents()->GetController().CopyStateFromAndPrune(
404 &old_tab_contents->web_contents()->GetController()); 404 &old_tab_contents->web_contents()->GetController());
405 old_tab_contents->core_tab_helper()->delegate()-> 405 CoreTabHelper::FromWebContents(old_tab_contents->web_contents())->delegate()->
406 SwapTabContents(old_tab_contents, new_tab_contents); 406 SwapTabContents(old_tab_contents->web_contents(),
407 new_tab_contents->web_contents());
407 prerender_contents->CommitHistory(new_tab_contents); 408 prerender_contents->CommitHistory(new_tab_contents);
408 409
409 GURL icon_url = prerender_contents->icon_url(); 410 GURL icon_url = prerender_contents->icon_url();
410 if (!icon_url.is_empty()) { 411 if (!icon_url.is_empty()) {
411 std::vector<FaviconURL> urls; 412 std::vector<FaviconURL> urls;
412 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON)); 413 urls.push_back(FaviconURL(icon_url, FaviconURL::FAVICON));
413 new_tab_contents->favicon_tab_helper()->OnUpdateFaviconURL( 414 new_tab_contents->favicon_tab_helper()->OnUpdateFaviconURL(
414 prerender_contents->page_id(), 415 prerender_contents->page_id(),
415 urls); 416 urls);
416 } 417 }
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 if (!render_process_host || !render_process_host->GetBrowserContext()) 1290 if (!render_process_host || !render_process_host->GetBrowserContext())
1290 return NULL; 1291 return NULL;
1291 Profile* profile = Profile::FromBrowserContext( 1292 Profile* profile = Profile::FromBrowserContext(
1292 render_process_host->GetBrowserContext()); 1293 render_process_host->GetBrowserContext());
1293 if (!profile) 1294 if (!profile)
1294 return NULL; 1295 return NULL;
1295 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); 1296 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile);
1296 } 1297 }
1297 1298
1298 } // namespace prerender 1299 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/printing/print_preview_tab_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698