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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 // Set up the data sources that Instant uses on the NTP. | 102 // Set up the data sources that Instant uses on the NTP. |
103 #if defined(ENABLE_THEMES) | 103 #if defined(ENABLE_THEMES) |
104 // Listen for theme installation. | 104 // Listen for theme installation. |
105 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 105 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
106 content::Source<ThemeService>( | 106 content::Source<ThemeService>( |
107 ThemeServiceFactory::GetForProfile(profile_))); | 107 ThemeServiceFactory::GetForProfile(profile_))); |
108 | 108 |
109 content::URLDataSource::Add(profile_, new ThemeSource(profile_)); | 109 content::URLDataSource::Add(profile_, new ThemeSource(profile_)); |
110 #endif // defined(ENABLE_THEMES) | 110 #endif // defined(ENABLE_THEMES) |
111 | 111 |
112 #if !defined(OS_ANDROID) | |
Nico
2014/04/25 20:22:04
This change isn't obvious to me. Maybe "// Thumbna
aurimas (slooooooooow)
2014/04/25 21:23:38
We don't use instant_service.cc at on Android, but
| |
112 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, false)); | 113 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, false)); |
113 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, true)); | 114 content::URLDataSource::Add(profile_, new ThumbnailSource(profile_, true)); |
114 content::URLDataSource::Add(profile_, new ThumbnailListSource(profile_)); | 115 content::URLDataSource::Add(profile_, new ThumbnailListSource(profile_)); |
116 #endif // !defined(OS_ANDROID) | |
117 | |
115 content::URLDataSource::Add( | 118 content::URLDataSource::Add( |
116 profile_, new FaviconSource(profile_, FaviconSource::FAVICON)); | 119 profile_, new FaviconSource(profile_, FaviconSource::FAVICON)); |
117 content::URLDataSource::Add(profile_, new LocalNtpSource(profile_)); | 120 content::URLDataSource::Add(profile_, new LocalNtpSource(profile_)); |
118 content::URLDataSource::Add(profile_, new MostVisitedIframeSource()); | 121 content::URLDataSource::Add(profile_, new MostVisitedIframeSource()); |
119 if (suggestions::SuggestionsService::IsEnabled()) { | 122 if (suggestions::SuggestionsService::IsEnabled()) { |
120 content::URLDataSource::Add( | 123 content::URLDataSource::Add( |
121 profile_, new suggestions::SuggestionsSource(profile_)); | 124 profile_, new suggestions::SuggestionsSource(profile_)); |
122 } | 125 } |
123 | 126 |
124 profile_pref_registrar_.Init(profile_->GetPrefs()); | 127 profile_pref_registrar_.Init(profile_->GetPrefs()); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
447 void InstantService::ResetInstantSearchPrerenderer() { | 450 void InstantService::ResetInstantSearchPrerenderer() { |
448 if (!chrome::ShouldPrefetchSearchResults()) | 451 if (!chrome::ShouldPrefetchSearchResults()) |
449 return; | 452 return; |
450 | 453 |
451 GURL url(chrome::GetSearchResultPrefetchBaseURL(profile_)); | 454 GURL url(chrome::GetSearchResultPrefetchBaseURL(profile_)); |
452 if (url.is_valid()) | 455 if (url.is_valid()) |
453 instant_prerenderer_.reset(new InstantSearchPrerenderer(profile_, url)); | 456 instant_prerenderer_.reset(new InstantSearchPrerenderer(profile_, url)); |
454 else | 457 else |
455 instant_prerenderer_.reset(); | 458 instant_prerenderer_.reset(); |
456 } | 459 } |
OLD | NEW |