| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 if (!instant_service) | 254 if (!instant_service) |
| 255 return; | 255 return; |
| 256 | 256 |
| 257 TabStripModel* tab_model = browser_->tab_strip_model(); | 257 TabStripModel* tab_model = browser_->tab_strip_model(); |
| 258 int count = tab_model->count(); | 258 int count = tab_model->count(); |
| 259 for (int index = 0; index < count; ++index) { | 259 for (int index = 0; index < count; ++index) { |
| 260 content::WebContents* contents = tab_model->GetWebContentsAt(index); | 260 content::WebContents* contents = tab_model->GetWebContentsAt(index); |
| 261 if (!contents) | 261 if (!contents) |
| 262 continue; | 262 continue; |
| 263 | 263 |
| 264 // A Local NTP always runs in the Instant process, so reloading it is | |
| 265 // neither useful nor necessary. However, the Local NTP does not reflect | |
| 266 // whether Google is the default search engine or not. This is achieved | |
| 267 // through a URL parameter, so reloading the existing URL won't fix that | |
| 268 // (i.e., the Local NTP may now show an incorrect search engine logo). | |
| 269 // TODO(kmadhusu): Fix. | |
| 270 if (contents->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl)) | |
| 271 continue; | |
| 272 | |
| 273 if (!instant_service->IsInstantProcess( | 264 if (!instant_service->IsInstantProcess( |
| 274 contents->GetRenderProcessHost()->GetID())) | 265 contents->GetRenderProcessHost()->GetID())) |
| 275 continue; | 266 continue; |
| 276 | 267 |
| 277 // Reload the contents to ensure that it gets assigned to a non-priviledged | 268 // Reload the contents to ensure that it gets assigned to a non-priviledged |
| 278 // renderer. | 269 // renderer. |
| 279 contents->GetController().Reload(false); | 270 contents->GetController().Reload(false); |
| 280 } | 271 } |
| 281 instant_.OnDefaultSearchProviderChanged(); | 272 instant_.OnDefaultSearchProviderChanged(); |
| 282 } | 273 } |
| OLD | NEW |