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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the previous fix Created 9 years, 7 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) 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/most_visited_handler.h" 5 #include "chrome/browser/ui/webui/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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 if (ts) 358 if (ts)
359 ts->AddBlacklistedURL(url); 359 ts->AddBlacklistedURL(url);
360 } 360 }
361 361
362 std::string MostVisitedHandler::GetDictionaryKeyForURL(const std::string& url) { 362 std::string MostVisitedHandler::GetDictionaryKeyForURL(const std::string& url) {
363 return MD5String(url); 363 return MD5String(url);
364 } 364 }
365 365
366 // static 366 // static
367 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) { 367 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) {
368 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedURLsBlacklist); 368 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedURLsBlacklist,
369 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedPinnedURLs); 369 false /* don't sync pref */);
370 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedPinnedURLs,
371 false /* don't sync pref */);
370 } 372 }
371 373
372 // static 374 // static
373 std::vector<GURL> MostVisitedHandler::GetPrePopulatedUrls() { 375 std::vector<GURL> MostVisitedHandler::GetPrePopulatedUrls() {
374 const std::vector<MostVisitedPage> pages = 376 const std::vector<MostVisitedPage> pages =
375 MostVisitedHandler::GetPrePopulatedPages(); 377 MostVisitedHandler::GetPrePopulatedPages();
376 std::vector<GURL> page_urls; 378 std::vector<GURL> page_urls;
377 for (size_t i = 0; i < pages.size(); ++i) 379 for (size_t i = 0; i < pages.size(); ++i)
378 page_urls.push_back(pages[i].url); 380 page_urls.push_back(pages[i].url);
379 return page_urls; 381 return page_urls;
380 } 382 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698