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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Set up the data sources that Instant uses on the NTP. | 86 // Set up the data sources that Instant uses on the NTP. |
87 #if defined(ENABLE_THEMES) | 87 #if defined(ENABLE_THEMES) |
88 // Listen for theme installation. | 88 // Listen for theme installation. |
89 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 89 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
90 content::Source<ThemeService>( | 90 content::Source<ThemeService>( |
91 ThemeServiceFactory::GetForProfile(profile_))); | 91 ThemeServiceFactory::GetForProfile(profile_))); |
92 | 92 |
93 content::URLDataSource::Add(profile, new ThemeSource(profile)); | 93 content::URLDataSource::Add(profile, new ThemeSource(profile)); |
94 #endif // defined(ENABLE_THEMES) | 94 #endif // defined(ENABLE_THEMES) |
95 | 95 |
96 content::URLDataSource::Add(profile, new ThumbnailSource(profile)); | 96 content::URLDataSource::Add(profile, new ThumbnailSource(profile, false)); |
| 97 content::URLDataSource::Add(profile, new ThumbnailSource(profile, true)); |
97 content::URLDataSource::Add(profile, new FaviconSource( | 98 content::URLDataSource::Add(profile, new FaviconSource( |
98 profile, FaviconSource::FAVICON)); | 99 profile, FaviconSource::FAVICON)); |
99 content::URLDataSource::Add(profile, new LocalNtpSource(profile)); | 100 content::URLDataSource::Add(profile, new LocalNtpSource(profile)); |
100 content::URLDataSource::Add(profile, new MostVisitedIframeSource()); | 101 content::URLDataSource::Add(profile, new MostVisitedIframeSource()); |
101 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 102 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
102 content::Source<Profile>(profile_)); | 103 content::Source<Profile>(profile_)); |
103 } | 104 } |
104 | 105 |
105 InstantService::~InstantService() { | 106 InstantService::~InstantService() { |
106 } | 107 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 theme_service->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION); | 387 theme_service->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION); |
387 } | 388 } |
388 | 389 |
389 FOR_EACH_OBSERVER(InstantServiceObserver, observers_, | 390 FOR_EACH_OBSERVER(InstantServiceObserver, observers_, |
390 ThemeInfoChanged(*theme_info_)); | 391 ThemeInfoChanged(*theme_info_)); |
391 } | 392 } |
392 | 393 |
393 InstantNTPPrerenderer* InstantService::ntp_prerenderer() { | 394 InstantNTPPrerenderer* InstantService::ntp_prerenderer() { |
394 return &ntp_prerenderer_; | 395 return &ntp_prerenderer_; |
395 } | 396 } |
OLD | NEW |