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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if (search_terms.empty()) | 129 if (search_terms.empty()) |
130 return false; | 130 return false; |
131 | 131 |
132 return instant_.SubmitQuery(search_terms); | 132 return instant_.SubmitQuery(search_terms); |
133 } | 133 } |
134 | 134 |
135 Profile* BrowserInstantController::profile() const { | 135 Profile* BrowserInstantController::profile() const { |
136 return browser_->profile(); | 136 return browser_->profile(); |
137 } | 137 } |
138 | 138 |
| 139 const TabStripModel* BrowserInstantController::tab_strip_model() const { |
| 140 return browser_->tab_strip_model(); |
| 141 } |
| 142 |
139 void BrowserInstantController::ReplaceWebContentsAt( | 143 void BrowserInstantController::ReplaceWebContentsAt( |
140 int index, | 144 int index, |
141 scoped_ptr<content::WebContents> new_contents) { | 145 scoped_ptr<content::WebContents> new_contents) { |
142 DCHECK_NE(TabStripModel::kNoTab, index); | 146 DCHECK_NE(TabStripModel::kNoTab, index); |
143 scoped_ptr<content::WebContents> old_contents(browser_->tab_strip_model()-> | 147 scoped_ptr<content::WebContents> old_contents(browser_->tab_strip_model()-> |
144 ReplaceWebContentsAt(index, new_contents.release())); | 148 ReplaceWebContentsAt(index, new_contents.release())); |
145 instant_unload_handler_.RunUnloadListenersOrDestroy(old_contents.Pass(), | 149 instant_unload_handler_.RunUnloadListenersOrDestroy(old_contents.Pass(), |
146 index); | 150 index); |
147 } | 151 } |
148 | 152 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (!instant_service->IsInstantProcess( | 277 if (!instant_service->IsInstantProcess( |
274 contents->GetRenderProcessHost()->GetID())) | 278 contents->GetRenderProcessHost()->GetID())) |
275 continue; | 279 continue; |
276 | 280 |
277 // Reload the contents to ensure that it gets assigned to a non-priviledged | 281 // Reload the contents to ensure that it gets assigned to a non-priviledged |
278 // renderer. | 282 // renderer. |
279 contents->GetController().Reload(false); | 283 contents->GetController().Reload(false); |
280 } | 284 } |
281 instant_.OnDefaultSearchProviderChanged(); | 285 instant_.OnDefaultSearchProviderChanged(); |
282 } | 286 } |
OLD | NEW |