| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/webui/ntp/most_visited_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 void MostVisitedHandler::RegisterMessages() { | 74 void MostVisitedHandler::RegisterMessages() { |
| 75 Profile* profile = Profile::FromWebUI(web_ui()); | 75 Profile* profile = Profile::FromWebUI(web_ui()); |
| 76 // Set up our sources for thumbnail and favicon data. | 76 // Set up our sources for thumbnail and favicon data. |
| 77 content::URLDataSource::Add(profile, new ThumbnailSource(profile, false)); | 77 content::URLDataSource::Add(profile, new ThumbnailSource(profile, false)); |
| 78 content::URLDataSource::Add(profile, new ThumbnailSource(profile, true)); | 78 content::URLDataSource::Add(profile, new ThumbnailSource(profile, true)); |
| 79 | 79 |
| 80 // Set up our sources for top-sites data. | 80 // Set up our sources for top-sites data. |
| 81 content::URLDataSource::Add(profile, new ThumbnailListSource(profile)); | 81 content::URLDataSource::Add(profile, new ThumbnailListSource(profile)); |
| 82 | 82 |
| 83 // Register chrome://fallback-icon as a data source for fallback icons. | 83 // Register chrome://fallback-icon as a data source for fallback icons. |
| 84 content::URLDataSource::Add(profile, new FallbackIconSource()); | 84 content::URLDataSource::Add(profile, new FallbackIconSource(profile)); |
| 85 | 85 |
| 86 // Register chrome://favicon as a data source for favicons. | 86 // Register chrome://favicon as a data source for favicons. |
| 87 content::URLDataSource::Add( | 87 content::URLDataSource::Add( |
| 88 profile, new FaviconSource(profile, FaviconSource::FAVICON)); | 88 profile, new FaviconSource(profile, FaviconSource::FAVICON)); |
| 89 | 89 |
| 90 scoped_refptr<history::TopSites> top_sites = | 90 scoped_refptr<history::TopSites> top_sites = |
| 91 TopSitesFactory::GetForProfile(profile); | 91 TopSitesFactory::GetForProfile(profile); |
| 92 if (top_sites) { | 92 if (top_sites) { |
| 93 // TopSites updates itself after a delay. This is especially noticable when | 93 // TopSites updates itself after a delay. This is especially noticable when |
| 94 // your profile is empty. Ask TopSites to update itself when we're about to | 94 // your profile is empty. Ask TopSites to update itself when we're about to |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 return base::MD5String(url); | 271 return base::MD5String(url); |
| 272 } | 272 } |
| 273 | 273 |
| 274 // static | 274 // static |
| 275 void MostVisitedHandler::RegisterProfilePrefs( | 275 void MostVisitedHandler::RegisterProfilePrefs( |
| 276 user_prefs::PrefRegistrySyncable* registry) { | 276 user_prefs::PrefRegistrySyncable* registry) { |
| 277 registry->RegisterDictionaryPref( | 277 registry->RegisterDictionaryPref( |
| 278 prefs::kNtpMostVisitedURLsBlacklist, | 278 prefs::kNtpMostVisitedURLsBlacklist, |
| 279 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 279 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 280 } | 280 } |
| OLD | NEW |