Chromium Code Reviews| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 // static | 339 // static |
| 340 void NewTabUI::RegisterUserPrefs(PrefService* prefs) { | 340 void NewTabUI::RegisterUserPrefs(PrefService* prefs) { |
| 341 prefs->RegisterIntegerPref(prefs::kNTPPrefVersion, | 341 prefs->RegisterIntegerPref(prefs::kNTPPrefVersion, |
| 342 0, | 342 0, |
| 343 PrefService::UNSYNCABLE_PREF); | 343 PrefService::UNSYNCABLE_PREF); |
| 344 | 344 |
| 345 NewTabPageHandler::RegisterUserPrefs(prefs); | 345 NewTabPageHandler::RegisterUserPrefs(prefs); |
| 346 AppLauncherHandler::RegisterUserPrefs(prefs); | 346 AppLauncherHandler::RegisterUserPrefs(prefs); |
| 347 MostVisitedHandler::RegisterUserPrefs(prefs); | 347 MostVisitedHandler::RegisterUserPrefs(prefs); |
| 348 ShownSectionsHandler::RegisterUserPrefs(prefs); | 348 ShownSectionsHandler::RegisterUserPrefs(prefs); |
| 349 if (Ntp4Enabled()) | |
|
arv (Not doing code reviews)
2011/08/15 17:46:30
Ntp -> NTP in C++ code
csilv
2011/08/15 18:24:28
Done.
| |
| 350 BookmarksHandler::RegisterUserPrefs(prefs); | |
| 349 | 351 |
| 350 UpdateUserPrefsVersion(prefs); | 352 UpdateUserPrefsVersion(prefs); |
| 351 } | 353 } |
| 352 | 354 |
| 353 // static | 355 // static |
| 354 bool NewTabUI::UpdateUserPrefsVersion(PrefService* prefs) { | 356 bool NewTabUI::UpdateUserPrefsVersion(PrefService* prefs) { |
| 355 const int old_pref_version = prefs->GetInteger(prefs::kNTPPrefVersion); | 357 const int old_pref_version = prefs->GetInteger(prefs::kNTPPrefVersion); |
| 356 if (old_pref_version != current_pref_version()) { | 358 if (old_pref_version != current_pref_version()) { |
| 357 MigrateUserPrefs(prefs, old_pref_version, current_pref_version()); | 359 MigrateUserPrefs(prefs, old_pref_version, current_pref_version()); |
| 358 prefs->SetInteger(prefs::kNTPPrefVersion, current_pref_version()); | 360 prefs->SetInteger(prefs::kNTPPrefVersion, current_pref_version()); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 456 SendResponse(request_id, html_bytes); | 458 SendResponse(request_id, html_bytes); |
| 457 } | 459 } |
| 458 | 460 |
| 459 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 461 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
| 460 return "text/html"; | 462 return "text/html"; |
| 461 } | 463 } |
| 462 | 464 |
| 463 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 465 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
| 464 return false; | 466 return false; |
| 465 } | 467 } |
| OLD | NEW |