Chromium Code Reviews| Index: chrome/browser/search/instant_service.cc |
| diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc |
| index 1144e405f7885dd2572749e7fd40575caf337fa9..c1d486c0bac6ab7a970ba2669c325b29501ec466 100644 |
| --- a/chrome/browser/search/instant_service.cc |
| +++ b/chrome/browser/search/instant_service.cc |
| @@ -19,6 +19,8 @@ |
| #include "chrome/browser/themes/theme_service_factory.h" |
| #include "chrome/browser/thumbnails/thumbnail_list_source.h" |
| #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
| +#include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" |
| +#include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h" |
| #include "chrome/browser/ui/webui/favicon_source.h" |
| #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
| #include "chrome/browser/ui/webui/theme_source.h" |
| @@ -420,6 +422,14 @@ void InstantService::OnTemplateURLServiceChanged() { |
| ResetInstantSearchPrerenderer(); |
| FOR_EACH_OBSERVER(InstantServiceObserver, observers_, |
| DefaultSearchProviderChanged()); |
| + |
| + // Update the New Tab Page interceptor with the new URL. |
| + NewTabPageInterceptorService* service = |
| + NewTabPageInterceptorServiceFactory::GetForProfile(profile_); |
| + if (service) { |
| + GURL new_tab_page_url(chrome::GetNewTabPageURL(profile_)); |
| + service->UpdateDefaultSearchProvider(new_tab_page_url); |
| + } |
|
mmenke
2015/01/15 22:35:30
Can't the service just sign up as an InstantServic
Mathieu
2015/01/15 22:42:09
I tried for a long time to make that work. It turn
mmenke
2015/01/15 23:22:21
Did you have all those "DCHECK_CURRENTLY_ON(conten
kmadhusu
2015/01/16 00:13:12
(Just curious) Did you get a chance to find the cu
mmenke
2015/01/16 17:54:04
Currently, the InstantService is created once prof
mmenke
2015/01/16 22:04:16
Shouldn't we just be watching the TemplateURLServi
Mathieu
2015/01/21 21:30:02
Newest patch does that, have a look.
|
| } |
| } |