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

Unified Diff: chrome/browser/prefs/browser_ui_prefs_migrator.h

Issue 511393003: No longer register app window placement preference keys on the fly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update to ToT Created 6 years, 3 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/browser/devtools/devtools_window.cc ('k') | chrome/browser/prefs/browser_ui_prefs_migrator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/browser_ui_prefs_migrator.h
diff --git a/chrome/browser/prefs/browser_ui_prefs_migrator.h b/chrome/browser/prefs/browser_ui_prefs_migrator.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a918239f6e089fc4c7a29bd7a3ba6e458f7b180
--- /dev/null
+++ b/chrome/browser/prefs/browser_ui_prefs_migrator.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_
+#define CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/prefs/pref_store.h"
+#include "base/prefs/writeable_pref_store.h"
+
+// When prefs are loaded from disk this class migrates some previously
+// dynamically registered preferences to their new home in a statically
+// registered dictionary. It can't follow the usual migration pattern because
+// it is migrating preferences that aren't registered at migration time and has
+// to iterate over a raw DictionaryValue looking for keys to migrate.
+//
+// Objects of this class delete themselves after the migration.
+//
+// TODO(dgrogan): Delete this for m41. See http://crbug.com/167256.
+
+class BrowserUIPrefsMigrator : public PrefStore::Observer {
+ public:
+ explicit BrowserUIPrefsMigrator(WriteablePrefStore* pref_store);
+
+ // Overrides from PrefStore::Observer.
+ virtual void OnPrefValueChanged(const std::string& key) OVERRIDE {}
+ virtual void OnInitializationCompleted(bool succeeded) OVERRIDE;
+
+ private:
+ friend struct base::DefaultDeleter<BrowserUIPrefsMigrator>;
+
+ virtual ~BrowserUIPrefsMigrator();
+
+ WriteablePrefStore* pref_store_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserUIPrefsMigrator);
+};
+
+#endif // CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/prefs/browser_ui_prefs_migrator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698