| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 if (ts) | 361 if (ts) |
| 362 ts->AddBlacklistedURL(url); | 362 ts->AddBlacklistedURL(url); |
| 363 } | 363 } |
| 364 | 364 |
| 365 std::string MostVisitedHandler::GetDictionaryKeyForURL(const std::string& url) { | 365 std::string MostVisitedHandler::GetDictionaryKeyForURL(const std::string& url) { |
| 366 return MD5String(url); | 366 return MD5String(url); |
| 367 } | 367 } |
| 368 | 368 |
| 369 // static | 369 // static |
| 370 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) { | 370 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) { |
| 371 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedURLsBlacklist); | 371 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedURLsBlacklist, |
| 372 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedPinnedURLs); | 372 PrefService::UNSYNCABLE_PREF); |
| 373 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedPinnedURLs, |
| 374 PrefService::UNSYNCABLE_PREF); |
| 373 } | 375 } |
| 374 | 376 |
| 375 // static | 377 // static |
| 376 std::vector<GURL> MostVisitedHandler::GetPrePopulatedUrls() { | 378 std::vector<GURL> MostVisitedHandler::GetPrePopulatedUrls() { |
| 377 const std::vector<MostVisitedPage> pages = | 379 const std::vector<MostVisitedPage> pages = |
| 378 MostVisitedHandler::GetPrePopulatedPages(); | 380 MostVisitedHandler::GetPrePopulatedPages(); |
| 379 std::vector<GURL> page_urls; | 381 std::vector<GURL> page_urls; |
| 380 for (size_t i = 0; i < pages.size(); ++i) | 382 for (size_t i = 0; i < pages.size(); ++i) |
| 381 page_urls.push_back(pages[i].url); | 383 page_urls.push_back(pages[i].url); |
| 382 return page_urls; | 384 return page_urls; |
| 383 } | 385 } |
| OLD | NEW |