Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/instant_service.h" | 5 #include "chrome/browser/search/instant_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/favicon/chrome_fallback_icon_client_factory.h" | |
| 8 #include "chrome/browser/history/top_sites_factory.h" | 9 #include "chrome/browser/history/top_sites_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/instant_io_context.h" | 11 #include "chrome/browser/search/instant_io_context.h" |
| 11 #include "chrome/browser/search/instant_service_observer.h" | 12 #include "chrome/browser/search/instant_service_observer.h" |
| 12 #include "chrome/browser/search/most_visited_iframe_source.h" | 13 #include "chrome/browser/search/most_visited_iframe_source.h" |
| 13 #include "chrome/browser/search/search.h" | 14 #include "chrome/browser/search/search.h" |
| 14 #include "chrome/browser/search/suggestions/suggestions_source.h" | 15 #include "chrome/browser/search/suggestions/suggestions_source.h" |
| 15 #include "chrome/browser/search_engines/template_url_service_factory.h" | 16 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 16 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 17 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 17 #include "chrome/browser/themes/theme_properties.h" | 18 #include "chrome/browser/themes/theme_properties.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 | 119 |
| 119 // TODO(aurimas) remove this #if once instant_service.cc is no longer compiled | 120 // TODO(aurimas) remove this #if once instant_service.cc is no longer compiled |
| 120 // on Android. | 121 // on Android. |
| 121 #if !defined(OS_ANDROID) | 122 #if !defined(OS_ANDROID) |
| 122 content::URLDataSource::Add(profile_, new LocalNtpSource(profile_)); | 123 content::URLDataSource::Add(profile_, new LocalNtpSource(profile_)); |
| 123 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, false)); | 124 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, false)); |
| 124 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, true)); | 125 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, true)); |
| 125 content::URLDataSource::Add(profile_, new ThumbnailListSource(profile_)); | 126 content::URLDataSource::Add(profile_, new ThumbnailListSource(profile_)); |
| 126 #endif // !defined(OS_ANDROID) | 127 #endif // !defined(OS_ANDROID) |
| 127 | 128 |
| 128 content::URLDataSource::Add(profile_, new FallbackIconSource()); | 129 content::URLDataSource::Add(profile_, |
| 130 new FallbackIconSource( | |
| 131 ChromeFallbackIconClientFactory::GetForProfile(profile_))); | |
|
sdefresne
2015/03/16 09:11:29
FallbackIconSource only call the FallbackIconClien
huangs
2015/03/16 22:06:11
Done.
| |
| 129 content::URLDataSource::Add( | 132 content::URLDataSource::Add( |
| 130 profile_, new FaviconSource(profile_, FaviconSource::FAVICON)); | 133 profile_, new FaviconSource(profile_, FaviconSource::FAVICON)); |
| 131 content::URLDataSource::Add(profile_, new MostVisitedIframeSource()); | 134 content::URLDataSource::Add(profile_, new MostVisitedIframeSource()); |
| 132 content::URLDataSource::Add( | 135 content::URLDataSource::Add( |
| 133 profile_, new suggestions::SuggestionsSource(profile_)); | 136 profile_, new suggestions::SuggestionsSource(profile_)); |
| 134 } | 137 } |
| 135 | 138 |
| 136 InstantService::~InstantService() { | 139 InstantService::~InstantService() { |
| 137 if (template_url_service_) | 140 if (template_url_service_) |
| 138 template_url_service_->RemoveObserver(this); | 141 template_url_service_->RemoveObserver(this); |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 } | 440 } |
| 438 | 441 |
| 439 void InstantService::ResetInstantSearchPrerenderer() { | 442 void InstantService::ResetInstantSearchPrerenderer() { |
| 440 if (!chrome::ShouldPrefetchSearchResults()) | 443 if (!chrome::ShouldPrefetchSearchResults()) |
| 441 return; | 444 return; |
| 442 | 445 |
| 443 GURL url(chrome::GetSearchResultPrefetchBaseURL(profile_)); | 446 GURL url(chrome::GetSearchResultPrefetchBaseURL(profile_)); |
| 444 instant_prerenderer_.reset( | 447 instant_prerenderer_.reset( |
| 445 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : NULL); | 448 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : NULL); |
| 446 } | 449 } |
| OLD | NEW |