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

Unified Diff: chrome/browser/dom_ui/new_tab_ui.h

Issue 337011: NTP: Allow hiding tips and bookmark sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/new_tab_ui.h
===================================================================
--- chrome/browser/dom_ui/new_tab_ui.h (revision 30053)
+++ chrome/browser/dom_ui/new_tab_ui.h (working copy)
@@ -10,6 +10,7 @@
#include "chrome/browser/dom_ui/dom_ui.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
#include "chrome/common/notification_registrar.h"
+#include "testing/gtest/include/gtest/gtest_prod.h"
class GURL;
class MessageLoop;
@@ -29,6 +30,8 @@
virtual void RenderViewReused(RenderViewHost* render_view_host);
static void RegisterUserPrefs(PrefService* prefs);
+ static void MigrateUserPrefs(PrefService* prefs, int old_pref_version,
+ int new_pref_version);
// Whether we should disable the web resources backend service
static bool WebResourcesEnabled();
@@ -43,6 +46,9 @@
const string16& title,
const GURL& gurl);
+ // The current preference version.
+ static const int current_pref_version() { return current_pref_version_; }
+
class NewTabHTMLSource : public ChromeURLDataManager::DataSource {
public:
explicit NewTabHTMLSource(Profile* profile);
@@ -102,6 +108,8 @@
};
private:
+ FRIEND_TEST(NewTabUITest, UpdateUserPrefsVersion);
+
void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
@@ -109,6 +117,10 @@
// Reset the CSS caches.
void InitializeCSSCaches();
+ // Updates the user prefs version and calls |MigrateUserPrefs| if needed.
+ // Returns true if the version was updated.
+ static bool UpdateUserPrefsVersion(PrefService* prefs);
+
NotificationRegistrar registrar_;
// The message id that should be displayed in this NewTabUIContents
@@ -119,6 +131,9 @@
// what HTML to load.
bool incognito_;
+ // The preference version. This used for migrating prefs of the NTP.
+ static const int current_pref_version_ = 1;
+
DISALLOW_COPY_AND_ASSIGN(NewTabUI);
};
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698