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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 10553029: Handle interface to prerenders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediate to final reviews! Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index 0b80d5769852abf5d88f4f35bf13370b1392cc58..5bbd5a70951d9af3fb3c6cc637bee75abf837b2d 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -1110,21 +1110,19 @@ void OmniboxEditModel::DoPrerender(const AutocompleteMatch& match) {
// It's possible the tab strip does not have an active tab contents, for
// instance if the tab has been closed or on return from a sleep state
// (http://crbug.com/105689)
- TabContents* tab = controller_->GetTabContents();
- if (!tab)
- return;
- prerender::PrerenderManager* prerender_manager =
- prerender::PrerenderManagerFactory::GetForProfile(tab->profile());
- if (!prerender_manager)
- return;
- content::RenderViewHost* current_host =
- tab->web_contents()->GetRenderViewHost();
- gfx::Rect container_bounds;
- tab->web_contents()->GetView()->GetContainerBounds(&container_bounds);
- prerender_manager->AddPrerenderFromOmnibox(
- match.destination_url, current_host->GetSessionStorageNamespace(),
- container_bounds.size());
+ if (TabContents* tab = controller_->GetTabContents()) {
Peter Kasting 2012/07/13 19:35:09 Nit: Don't combine set + test like this. The old
gavinp 2012/07/13 19:59:10 I can definitely change this if there's consensus,
Peter Kasting 2012/07/13 20:56:41 I haven't seen this used in Chromium code and I re
+ gfx::Rect container_bounds;
+ tab->web_contents()->GetView()->GetContainerBounds(&container_bounds);
+ content::RenderViewHost* current_host =
Peter Kasting 2012/07/13 19:35:09 Nit: Could just inline these next two temps into t
gavinp 2012/07/13 19:59:10 Done.
+ tab->web_contents()->GetRenderViewHost();
+ AutocompleteActionPredictor* action_predictor =
+ AutocompleteActionPredictorFactory::GetForProfile(profile_);
+
Peter Kasting 2012/07/13 19:35:09 Nit: Unnecessary blank line
gavinp 2012/07/13 19:59:10 Done.
+ action_predictor->StartPrerendering(
+ match.destination_url, current_host->GetSessionStorageNamespace(),
+ container_bounds.size());
+ }
}
void OmniboxEditModel::DoPreconnect(const AutocompleteMatch& match) {
« no previous file with comments | « chrome/browser/prerender/prerender_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698