| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |