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

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

Issue 23477033: Implementing URL prefix match for history thumbnail cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding url_utils.*; adding chrome://thumb2; refactoring. 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/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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 UMA_HISTOGRAM_ENUMERATION("NewTabPage.MostVisitedAction", action_id, 72 UMA_HISTOGRAM_ENUMERATION("NewTabPage.MostVisitedAction", action_id,
73 NUM_NTP_FOLLOW_ACTIONS); 73 NUM_NTP_FOLLOW_ACTIONS);
74 } 74 }
75 } 75 }
76 76
77 void MostVisitedHandler::RegisterMessages() { 77 void MostVisitedHandler::RegisterMessages() {
78 Profile* profile = Profile::FromWebUI(web_ui()); 78 Profile* profile = Profile::FromWebUI(web_ui());
79 // Set up our sources for thumbnail and favicon data. 79 // Set up our sources for thumbnail and favicon data.
80 ThumbnailSource* thumbnail_src = new ThumbnailSource(profile); 80 ThumbnailSource* thumbnail_src_exact = new ThumbnailSource(profile, false);
81 content::URLDataSource::Add(profile, thumbnail_src); 81 content::URLDataSource::Add(profile, thumbnail_src_exact);
82
83 ThumbnailSource* thumbnail_src_prefix = new ThumbnailSource(profile, true);
84 content::URLDataSource::Add(profile, thumbnail_src_prefix);
82 85
83 #if defined(OS_ANDROID) 86 #if defined(OS_ANDROID)
84 // Register chrome://touch-icon as a data source for touch icons or favicons. 87 // Register chrome://touch-icon as a data source for touch icons or favicons.
85 content::URLDataSource::Add(profile, 88 content::URLDataSource::Add(profile,
86 new FaviconSource(profile, FaviconSource::ANY)); 89 new FaviconSource(profile, FaviconSource::ANY));
87 #endif 90 #endif
88 // Register chrome://favicon as a data source for favicons. 91 // Register chrome://favicon as a data source for favicons.
89 content::URLDataSource::Add( 92 content::URLDataSource::Add(
90 profile, new FaviconSource(profile, FaviconSource::FAVICON)); 93 profile, new FaviconSource(profile, FaviconSource::FAVICON));
91 94
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 #endif 295 #endif
293 } 296 }
294 297
295 // static 298 // static
296 void MostVisitedHandler::RegisterProfilePrefs( 299 void MostVisitedHandler::RegisterProfilePrefs(
297 user_prefs::PrefRegistrySyncable* registry) { 300 user_prefs::PrefRegistrySyncable* registry) {
298 registry->RegisterDictionaryPref( 301 registry->RegisterDictionaryPref(
299 prefs::kNtpMostVisitedURLsBlacklist, 302 prefs::kNtpMostVisitedURLsBlacklist,
300 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 303 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
301 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698