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

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: 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 ChromeURLDataManager::AddDataSource(profile,
79 new FaviconSource(profile, FaviconSource::ANY));
80 #endif
77 ChromeURLDataManager::AddDataSource(profile, 81 ChromeURLDataManager::AddDataSource(profile,
78 new FaviconSource(profile, FaviconSource::FAVICON)); 82 new FaviconSource(profile, FaviconSource::FAVICON));
Evan Stade 2012/10/02 14:42:43 you need both of these on android?
newt (away) 2012/10/05 13:31:05 Yes. Added comments to explain. ANY is perhaps n
79 83
80 history::TopSites* ts = profile->GetTopSites(); 84 history::TopSites* ts = profile->GetTopSites();
81 if (ts) { 85 if (ts) {
82 // TopSites updates itself after a delay. This is especially noticable when 86 // 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 87 // your profile is empty. Ask TopSites to update itself when we're about to
84 // show the new tab page. 88 // show the new tab page.
85 ts->SyncWithHistory(); 89 ts->SyncWithHistory();
86 90
87 // Register for notification when TopSites changes so that we can update 91 // Register for notification when TopSites changes so that we can update
88 // ourself. 92 // ourself.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 252
249 std::string MostVisitedHandler::GetDictionaryKeyForUrl(const std::string& url) { 253 std::string MostVisitedHandler::GetDictionaryKeyForUrl(const std::string& url) {
250 return base::MD5String(url); 254 return base::MD5String(url);
251 } 255 }
252 256
253 // static 257 // static
254 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) { 258 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) {
255 prefs->RegisterDictionaryPref(prefs::kNtpMostVisitedURLsBlacklist, 259 prefs->RegisterDictionaryPref(prefs::kNtpMostVisitedURLsBlacklist,
256 PrefService::UNSYNCABLE_PREF); 260 PrefService::UNSYNCABLE_PREF);
257 } 261 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698