| 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 "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/instant_service.h" | 10 #include "chrome/browser/search/instant_service.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 content::WebContents* BrowserInstantController::GetActiveWebContents() const { | 148 content::WebContents* BrowserInstantController::GetActiveWebContents() const { |
| 149 return browser_->tab_strip_model()->GetActiveWebContents(); | 149 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void BrowserInstantController::ActiveTabChanged() { | 152 void BrowserInstantController::ActiveTabChanged() { |
| 153 instant_.ActiveTabChanged(); | 153 instant_.ActiveTabChanged(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void BrowserInstantController::TabDeactivated(content::WebContents* contents) { | 156 void BrowserInstantController::TabDeactivated(content::WebContents* contents) { |
| 157 instant_.TabDeactivated(contents); | |
| 158 | |
| 159 InstantSearchPrerenderer* prerenderer = | 157 InstantSearchPrerenderer* prerenderer = |
| 160 GetInstantSearchPrerenderer(profile()); | 158 GetInstantSearchPrerenderer(profile()); |
| 161 if (prerenderer) | 159 if (prerenderer) |
| 162 prerenderer->Cancel(); | 160 prerenderer->Cancel(); |
| 163 } | 161 } |
| 164 | 162 |
| 165 void BrowserInstantController::ModelChanged( | 163 void BrowserInstantController::ModelChanged( |
| 166 const SearchModel::State& old_state, | 164 const SearchModel::State& old_state, |
| 167 const SearchModel::State& new_state) { | 165 const SearchModel::State& new_state) { |
| 168 if (old_state.mode != new_state.mode) { | 166 if (old_state.mode != new_state.mode) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 params.referrer = content::Referrer(); | 211 params.referrer = content::Referrer(); |
| 214 params.transition_type = ui::PAGE_TRANSITION_RELOAD; | 212 params.transition_type = ui::PAGE_TRANSITION_RELOAD; |
| 215 contents->GetController().LoadURLWithParams(params); | 213 contents->GetController().LoadURLWithParams(params); |
| 216 } else { | 214 } else { |
| 217 // Reload the contents to ensure that it gets assigned to a | 215 // Reload the contents to ensure that it gets assigned to a |
| 218 // non-privileged renderer. | 216 // non-privileged renderer. |
| 219 TabReloader::Reload(contents); | 217 TabReloader::Reload(contents); |
| 220 } | 218 } |
| 221 } | 219 } |
| 222 } | 220 } |
| OLD | NEW |