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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 if (search_terms.empty()) | 152 if (search_terms.empty()) |
153 return false; | 153 return false; |
154 | 154 |
155 return instant_.SubmitQuery(search_terms); | 155 return instant_.SubmitQuery(search_terms); |
156 } | 156 } |
157 | 157 |
158 Profile* BrowserInstantController::profile() const { | 158 Profile* BrowserInstantController::profile() const { |
159 return browser_->profile(); | 159 return browser_->profile(); |
160 } | 160 } |
161 | 161 |
| 162 TabStripModel* BrowserInstantController::tab_strip_model() const { |
| 163 return browser_->tab_strip_model(); |
| 164 } |
| 165 |
162 void BrowserInstantController::CommitInstant( | 166 void BrowserInstantController::CommitInstant( |
163 scoped_ptr<content::WebContents> overlay, | 167 scoped_ptr<content::WebContents> overlay, |
164 bool in_new_tab) { | 168 bool in_new_tab) { |
165 const extensions::Extension* extension = | 169 const extensions::Extension* extension = |
166 profile()->GetExtensionService()->GetInstalledApp(overlay->GetURL()); | 170 profile()->GetExtensionService()->GetInstalledApp(overlay->GetURL()); |
167 if (extension) { | 171 if (extension) { |
168 AppLauncherHandler::RecordAppLaunchType( | 172 AppLauncherHandler::RecordAppLaunchType( |
169 extension_misc::APP_LAUNCH_OMNIBOX_INSTANT, | 173 extension_misc::APP_LAUNCH_OMNIBOX_INSTANT, |
170 extension->GetType()); | 174 extension->GetType()); |
171 } | 175 } |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 if (!instant_service->IsInstantProcess( | 432 if (!instant_service->IsInstantProcess( |
429 contents->GetRenderProcessHost()->GetID())) | 433 contents->GetRenderProcessHost()->GetID())) |
430 continue; | 434 continue; |
431 | 435 |
432 // Reload the contents to ensure that it gets assigned to a non-priviledged | 436 // Reload the contents to ensure that it gets assigned to a non-priviledged |
433 // renderer. | 437 // renderer. |
434 contents->GetController().Reload(false); | 438 contents->GetController().Reload(false); |
435 } | 439 } |
436 instant_.OnDefaultSearchProviderChanged(); | 440 instant_.OnDefaultSearchProviderChanged(); |
437 } | 441 } |
OLD | NEW |