| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/webui/new_tab_ui.h" | 7 #include "chrome/browser/ui/webui/new_tab_ui.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 } | 426 } |
| 427 | 427 |
| 428 void NewTabUI::InitializeCSSCaches() { | 428 void NewTabUI::InitializeCSSCaches() { |
| 429 Profile* profile = GetProfile(); | 429 Profile* profile = GetProfile(); |
| 430 ThemeSource* theme = new ThemeSource(profile); | 430 ThemeSource* theme = new ThemeSource(profile); |
| 431 profile->GetChromeURLDataManager()->AddDataSource(theme); | 431 profile->GetChromeURLDataManager()->AddDataSource(theme); |
| 432 } | 432 } |
| 433 | 433 |
| 434 // static | 434 // static |
| 435 void NewTabUI::RegisterUserPrefs(PrefService* prefs) { | 435 void NewTabUI::RegisterUserPrefs(PrefService* prefs) { |
| 436 prefs->RegisterIntegerPref(prefs::kNTPPrefVersion, 0); | 436 prefs->RegisterIntegerPref(prefs::kNTPPrefVersion, |
| 437 0, |
| 438 false /* don't sync pref */); |
| 437 | 439 |
| 438 MostVisitedHandler::RegisterUserPrefs(prefs); | 440 MostVisitedHandler::RegisterUserPrefs(prefs); |
| 439 ShownSectionsHandler::RegisterUserPrefs(prefs); | 441 ShownSectionsHandler::RegisterUserPrefs(prefs); |
| 440 | 442 |
| 441 UpdateUserPrefsVersion(prefs); | 443 UpdateUserPrefsVersion(prefs); |
| 442 } | 444 } |
| 443 | 445 |
| 444 // static | 446 // static |
| 445 bool NewTabUI::UpdateUserPrefsVersion(PrefService* prefs) { | 447 bool NewTabUI::UpdateUserPrefsVersion(PrefService* prefs) { |
| 446 const int old_pref_version = prefs->GetInteger(prefs::kNTPPrefVersion); | 448 const int old_pref_version = prefs->GetInteger(prefs::kNTPPrefVersion); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 SendResponse(request_id, html_bytes); | 598 SendResponse(request_id, html_bytes); |
| 597 } | 599 } |
| 598 | 600 |
| 599 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 601 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
| 600 return "text/html"; | 602 return "text/html"; |
| 601 } | 603 } |
| 602 | 604 |
| 603 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 605 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
| 604 return false; | 606 return false; |
| 605 } | 607 } |
| OLD | NEW |