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

Side by Side Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 338633003: Prerender Instant search base url on omnibox focus event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 6 years, 6 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/ui/browser_instant_controller.h" 5 #include "chrome/browser/ui/browser_instant_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_web_ui.h" 9 #include "chrome/browser/extensions/extension_web_ui.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 105
106 content::WebContents* BrowserInstantController::GetActiveWebContents() const { 106 content::WebContents* BrowserInstantController::GetActiveWebContents() const {
107 return browser_->tab_strip_model()->GetActiveWebContents(); 107 return browser_->tab_strip_model()->GetActiveWebContents();
108 } 108 }
109 109
110 void BrowserInstantController::ActiveTabChanged() { 110 void BrowserInstantController::ActiveTabChanged() {
111 instant_.ActiveTabChanged(); 111 instant_.ActiveTabChanged();
112 } 112 }
113 113
114 void BrowserInstantController::TabInsertedAt(content::WebContents* contents,
115 int index,
116 bool foreground) {
117 if (foreground) {
118 InstantSearchPrerenderer* prerenderer =
119 GetInstantSearchPrerenderer(profile());
120 if (prerenderer)
121 prerenderer->Init(
122 contents->GetController().GetSessionStorageNamespaceMap(),
123 contents->GetContainerBounds().size());
124 }
125 }
126
114 void BrowserInstantController::TabDeactivated(content::WebContents* contents) { 127 void BrowserInstantController::TabDeactivated(content::WebContents* contents) {
115 instant_.TabDeactivated(contents); 128 instant_.TabDeactivated(contents);
116 129
117 InstantSearchPrerenderer* prerenderer = 130 InstantSearchPrerenderer* prerenderer =
118 GetInstantSearchPrerenderer(profile()); 131 GetInstantSearchPrerenderer(profile());
119 if (prerenderer) 132 if (prerenderer)
120 prerenderer->Cancel(); 133 prerenderer->Cancel();
121 } 134 }
122 135
123 void BrowserInstantController::ModelChanged( 136 void BrowserInstantController::ModelChanged(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 content::RenderProcessHost* rph = contents->GetRenderProcessHost(); 171 content::RenderProcessHost* rph = contents->GetRenderProcessHost();
159 instant_service->SendSearchURLsToRenderer(rph); 172 instant_service->SendSearchURLsToRenderer(rph);
160 173
161 // Reload the contents to ensure that it gets assigned to a non-priviledged 174 // Reload the contents to ensure that it gets assigned to a non-priviledged
162 // renderer. 175 // renderer.
163 if (!instant_service->IsInstantProcess(rph->GetID())) 176 if (!instant_service->IsInstantProcess(rph->GetID()))
164 continue; 177 continue;
165 contents->GetController().Reload(false); 178 contents->GetController().Reload(false);
166 } 179 }
167 } 180 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698