OLD | NEW |
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 "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 if (search_terms.empty()) | 138 if (search_terms.empty()) |
139 return false; | 139 return false; |
140 | 140 |
141 return instant_.SubmitQuery(search_terms); | 141 return instant_.SubmitQuery(search_terms); |
142 } | 142 } |
143 | 143 |
144 Profile* BrowserInstantController::profile() const { | 144 Profile* BrowserInstantController::profile() const { |
145 return browser_->profile(); | 145 return browser_->profile(); |
146 } | 146 } |
147 | 147 |
| 148 const TabStripModel* BrowserInstantController::tab_strip_model() const { |
| 149 return browser_->tab_strip_model(); |
| 150 } |
| 151 |
148 void BrowserInstantController::ReplaceWebContentsAt( | 152 void BrowserInstantController::ReplaceWebContentsAt( |
149 int index, | 153 int index, |
150 scoped_ptr<content::WebContents> new_contents) { | 154 scoped_ptr<content::WebContents> new_contents) { |
151 DCHECK_NE(TabStripModel::kNoTab, index); | 155 DCHECK_NE(TabStripModel::kNoTab, index); |
152 scoped_ptr<content::WebContents> old_contents(browser_->tab_strip_model()-> | 156 scoped_ptr<content::WebContents> old_contents(browser_->tab_strip_model()-> |
153 ReplaceWebContentsAt(index, new_contents.release())); | 157 ReplaceWebContentsAt(index, new_contents.release())); |
154 instant_unload_handler_.RunUnloadListenersOrDestroy(old_contents.Pass(), | 158 instant_unload_handler_.RunUnloadListenersOrDestroy(old_contents.Pass(), |
155 index); | 159 index); |
156 } | 160 } |
157 | 161 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 if (!instant_service->IsInstantProcess( | 289 if (!instant_service->IsInstantProcess( |
286 contents->GetRenderProcessHost()->GetID())) | 290 contents->GetRenderProcessHost()->GetID())) |
287 continue; | 291 continue; |
288 | 292 |
289 // Reload the contents to ensure that it gets assigned to a non-priviledged | 293 // Reload the contents to ensure that it gets assigned to a non-priviledged |
290 // renderer. | 294 // renderer. |
291 contents->GetController().Reload(false); | 295 contents->GetController().Reload(false); |
292 } | 296 } |
293 instant_.OnDefaultSearchProviderChanged(); | 297 instant_.OnDefaultSearchProviderChanged(); |
294 } | 298 } |
OLD | NEW |