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

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

Issue 23477033: Implementing URL prefix match for history thumbnail cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replacing ASSERT_TRUE() << ... to NOTREACHED() << ... Created 7 years, 3 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/suggestions_page_handler.h" 5 #include "chrome/browser/ui/webui/ntp/suggestions_page_handler.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 UMA_HISTOGRAM_ENUMERATION("NewTabPage.SuggestedSitesAction", action_id, 58 UMA_HISTOGRAM_ENUMERATION("NewTabPage.SuggestedSitesAction", action_id,
59 NUM_NTP_FOLLOW_ACTIONS); 59 NUM_NTP_FOLLOW_ACTIONS);
60 } 60 }
61 } 61 }
62 62
63 void SuggestionsHandler::RegisterMessages() { 63 void SuggestionsHandler::RegisterMessages() {
64 Profile* profile = Profile::FromWebUI(web_ui()); 64 Profile* profile = Profile::FromWebUI(web_ui());
65 // Set up our sources for thumbnail and favicon data. 65 // Set up our sources for thumbnail and favicon data.
66 content::URLDataSource::Add(profile, new ThumbnailSource(profile)); 66 content::URLDataSource::Add(profile, new ThumbnailSource(profile, false));
67 content::URLDataSource::Add( 67 content::URLDataSource::Add(
68 profile, new FaviconSource(profile, FaviconSource::FAVICON)); 68 profile, new FaviconSource(profile, FaviconSource::FAVICON));
69 69
70 // TODO(georgey) change the source of the web-sites to provide our data. 70 // TODO(georgey) change the source of the web-sites to provide our data.
71 // Initial commit uses top sites as a data source. 71 // Initial commit uses top sites as a data source.
72 history::TopSites* top_sites = profile->GetTopSites(); 72 history::TopSites* top_sites = profile->GetTopSites();
73 if (top_sites) { 73 if (top_sites) {
74 // TopSites updates itself after a delay. This is especially noticable when 74 // TopSites updates itself after a delay. This is especially noticable when
75 // your profile is empty. Ask TopSites to update itself when we're about to 75 // your profile is empty. Ask TopSites to update itself when we're about to
76 // show the new tab page. 76 // show the new tab page.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 std::string SuggestionsHandler::GetDictionaryKeyForURL(const std::string& url) { 190 std::string SuggestionsHandler::GetDictionaryKeyForURL(const std::string& url) {
191 return base::MD5String(url); 191 return base::MD5String(url);
192 } 192 }
193 193
194 // static 194 // static
195 void SuggestionsHandler::RegisterProfilePrefs( 195 void SuggestionsHandler::RegisterProfilePrefs(
196 user_prefs::PrefRegistrySyncable* registry) { 196 user_prefs::PrefRegistrySyncable* registry) {
197 // TODO(georgey) add user preferences (such as own blacklist) as needed. 197 // TODO(georgey) add user preferences (such as own blacklist) as needed.
198 } 198 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.cc ('k') | chrome/browser/ui/webui/ntp/thumbnail_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698