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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix. And rebase 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 } 454 }
455 455
456 void NewTabUI::InitializeCSSCaches() { 456 void NewTabUI::InitializeCSSCaches() {
457 Profile* profile = GetProfile(); 457 Profile* profile = GetProfile();
458 ThemeSource* theme = new ThemeSource(profile); 458 ThemeSource* theme = new ThemeSource(profile);
459 profile->GetChromeURLDataManager()->AddDataSource(theme); 459 profile->GetChromeURLDataManager()->AddDataSource(theme);
460 } 460 }
461 461
462 // static 462 // static
463 void NewTabUI::RegisterUserPrefs(PrefService* prefs) { 463 void NewTabUI::RegisterUserPrefs(PrefService* prefs) {
464 prefs->RegisterIntegerPref(prefs::kNTPPrefVersion, 0); 464 prefs->RegisterIntegerPref(prefs::kNTPPrefVersion,
465 0,
466 PrefService::UNSYNCABLE_PREF);
465 467
466 MostVisitedHandler::RegisterUserPrefs(prefs); 468 MostVisitedHandler::RegisterUserPrefs(prefs);
467 ShownSectionsHandler::RegisterUserPrefs(prefs); 469 ShownSectionsHandler::RegisterUserPrefs(prefs);
468 470
469 UpdateUserPrefsVersion(prefs); 471 UpdateUserPrefsVersion(prefs);
470 } 472 }
471 473
472 // static 474 // static
473 bool NewTabUI::UpdateUserPrefsVersion(PrefService* prefs) { 475 bool NewTabUI::UpdateUserPrefsVersion(PrefService* prefs) {
474 const int old_pref_version = prefs->GetInteger(prefs::kNTPPrefVersion); 476 const int old_pref_version = prefs->GetInteger(prefs::kNTPPrefVersion);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 SendResponse(request_id, html_bytes); 626 SendResponse(request_id, html_bytes);
625 } 627 }
626 628
627 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { 629 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const {
628 return "text/html"; 630 return "text/html";
629 } 631 }
630 632
631 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { 633 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const {
632 return false; 634 return false;
633 } 635 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.cc ('k') | chrome/browser/ui/webui/ntp/shown_sections_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698