Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Side by Side Diff: chrome/browser/ui/webui/ntp/most_visited_handler.cc

Issue 11038014: [Android] Upstream remaining changes to NTP UI code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed indentation nit Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 NUM_NTP_FOLLOW_ACTIONS); 67 NUM_NTP_FOLLOW_ACTIONS);
68 } 68 }
69 } 69 }
70 70
71 void MostVisitedHandler::RegisterMessages() { 71 void MostVisitedHandler::RegisterMessages() {
72 Profile* profile = Profile::FromWebUI(web_ui()); 72 Profile* profile = Profile::FromWebUI(web_ui());
73 // Set up our sources for thumbnail and favicon data. 73 // Set up our sources for thumbnail and favicon data.
74 ThumbnailSource* thumbnail_src = new ThumbnailSource(profile); 74 ThumbnailSource* thumbnail_src = new ThumbnailSource(profile);
75 ChromeURLDataManager::AddDataSource(profile, thumbnail_src); 75 ChromeURLDataManager::AddDataSource(profile, thumbnail_src);
76 76
77 #if defined(OS_ANDROID)
78 // Register chrome://touch-icon as a data source for touch icons or favicons.
79 ChromeURLDataManager::AddDataSource(profile,
80 new FaviconSource(profile, FaviconSource::ANY));
81 #endif
82 // Register chrome://favicon as a data source for favicons.
77 ChromeURLDataManager::AddDataSource(profile, 83 ChromeURLDataManager::AddDataSource(profile,
78 new FaviconSource(profile, FaviconSource::FAVICON)); 84 new FaviconSource(profile, FaviconSource::FAVICON));
79 85
80 history::TopSites* ts = profile->GetTopSites(); 86 history::TopSites* ts = profile->GetTopSites();
81 if (ts) { 87 if (ts) {
82 // TopSites updates itself after a delay. This is especially noticable when 88 // TopSites updates itself after a delay. This is especially noticable when
83 // your profile is empty. Ask TopSites to update itself when we're about to 89 // your profile is empty. Ask TopSites to update itself when we're about to
84 // show the new tab page. 90 // show the new tab page.
85 ts->SyncWithHistory(); 91 ts->SyncWithHistory();
86 92
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 254
249 std::string MostVisitedHandler::GetDictionaryKeyForUrl(const std::string& url) { 255 std::string MostVisitedHandler::GetDictionaryKeyForUrl(const std::string& url) {
250 return base::MD5String(url); 256 return base::MD5String(url);
251 } 257 }
252 258
253 // static 259 // static
254 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) { 260 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) {
255 prefs->RegisterDictionaryPref(prefs::kNtpMostVisitedURLsBlacklist, 261 prefs->RegisterDictionaryPref(prefs::kNtpMostVisitedURLsBlacklist,
256 PrefService::UNSYNCABLE_PREF); 262 PrefService::UNSYNCABLE_PREF);
257 } 263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698