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

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

Issue 53283004: Adding support for forced URLs to TopSites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed GetAllMostVisited. Created 7 years, 1 month 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 has_blacklisted_urls_value); 161 has_blacklisted_urls_value);
162 pages_value_.reset(); 162 pages_value_.reset();
163 } 163 }
164 } 164 }
165 165
166 void MostVisitedHandler::StartQueryForMostVisited() { 166 void MostVisitedHandler::StartQueryForMostVisited() {
167 history::TopSites* ts = Profile::FromWebUI(web_ui())->GetTopSites(); 167 history::TopSites* ts = Profile::FromWebUI(web_ui())->GetTopSites();
168 if (ts) { 168 if (ts) {
169 ts->GetMostVisitedURLs( 169 ts->GetMostVisitedURLs(
170 base::Bind(&MostVisitedHandler::OnMostVisitedUrlsAvailable, 170 base::Bind(&MostVisitedHandler::OnMostVisitedUrlsAvailable,
171 weak_ptr_factory_.GetWeakPtr())); 171 weak_ptr_factory_.GetWeakPtr()), false);
172 } 172 }
173 } 173 }
174 174
175 void MostVisitedHandler::HandleBlacklistUrl(const ListValue* args) { 175 void MostVisitedHandler::HandleBlacklistUrl(const ListValue* args) {
176 std::string url = UTF16ToUTF8(ExtractStringValue(args)); 176 std::string url = UTF16ToUTF8(ExtractStringValue(args));
177 BlacklistUrl(GURL(url)); 177 BlacklistUrl(GURL(url));
178 } 178 }
179 179
180 void MostVisitedHandler::HandleRemoveUrlsFromBlacklist(const ListValue* args) { 180 void MostVisitedHandler::HandleRemoveUrlsFromBlacklist(const ListValue* args) {
181 DCHECK(args->GetSize() != 0); 181 DCHECK(args->GetSize() != 0);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 #endif 296 #endif
297 } 297 }
298 298
299 // static 299 // static
300 void MostVisitedHandler::RegisterProfilePrefs( 300 void MostVisitedHandler::RegisterProfilePrefs(
301 user_prefs::PrefRegistrySyncable* registry) { 301 user_prefs::PrefRegistrySyncable* registry) {
302 registry->RegisterDictionaryPref( 302 registry->RegisterDictionaryPref(
303 prefs::kNtpMostVisitedURLsBlacklist, 303 prefs::kNtpMostVisitedURLsBlacklist,
304 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 304 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
305 } 305 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/global_menu_bar_x11.cc ('k') | chrome/browser/ui/webui/ntp/thumbnail_list_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698