OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 #ifndef CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_ | 5 #ifndef CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_ |
6 #define CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_ | 6 #define CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/prefs/pref_store.h" | 9 #include "base/prefs/pref_store.h" |
10 #include "base/prefs/writeable_pref_store.h" | 10 #include "base/prefs/writeable_pref_store.h" |
11 | 11 |
12 // When prefs are loaded from disk this class migrates some previously | 12 // When prefs are loaded from disk this class migrates some previously |
13 // dynamically registered preferences to their new home in a statically | 13 // dynamically registered preferences to their new home in a statically |
14 // registered dictionary. It can't follow the usual migration pattern because | 14 // registered dictionary. It can't follow the usual migration pattern because |
15 // it is migrating preferences that aren't registered at migration time and has | 15 // it is migrating preferences that aren't registered at migration time and has |
16 // to iterate over a raw DictionaryValue looking for keys to migrate. | 16 // to iterate over a raw DictionaryValue looking for keys to migrate. |
17 // | 17 // |
18 // Objects of this class delete themselves after the migration. | 18 // Objects of this class delete themselves after the migration. |
19 // | 19 // |
20 // TODO(dgrogan): Delete this for m41. See http://crbug.com/167256. | 20 // TODO(dgrogan): Delete this for m41. See http://crbug.com/167256. |
21 | 21 |
22 class BrowserUIPrefsMigrator : public PrefStore::Observer { | 22 class BrowserUIPrefsMigrator : public PrefStore::Observer { |
23 public: | 23 public: |
24 explicit BrowserUIPrefsMigrator(WriteablePrefStore* pref_store); | 24 explicit BrowserUIPrefsMigrator(WriteablePrefStore* pref_store); |
25 | 25 |
26 // Overrides from PrefStore::Observer. | 26 // Overrides from PrefStore::Observer. |
27 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE {} | 27 virtual void OnPrefValueChanged(const std::string& key) override {} |
28 virtual void OnInitializationCompleted(bool succeeded) OVERRIDE; | 28 virtual void OnInitializationCompleted(bool succeeded) override; |
29 | 29 |
30 private: | 30 private: |
31 friend struct base::DefaultDeleter<BrowserUIPrefsMigrator>; | 31 friend struct base::DefaultDeleter<BrowserUIPrefsMigrator>; |
32 | 32 |
33 virtual ~BrowserUIPrefsMigrator(); | 33 virtual ~BrowserUIPrefsMigrator(); |
34 | 34 |
35 WriteablePrefStore* pref_store_; | 35 WriteablePrefStore* pref_store_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(BrowserUIPrefsMigrator); | 37 DISALLOW_COPY_AND_ASSIGN(BrowserUIPrefsMigrator); |
38 }; | 38 }; |
39 | 39 |
40 #endif // CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_ | 40 #endif // CHROME_BROWSER_PREFS_BROWSER_UI_PREFS_MIGRATOR_H_ |
OLD | NEW |