OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_PREFS_MIGRATOR_H_ | |
6 #define CHROME_BROWSER_UI_PREFS_MIGRATOR_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/prefs/pref_store.h" | |
10 #include "base/prefs/writeable_pref_store.h" | |
11 | |
12 // When prefs are loaded from disk this class migrates some previously | |
13 // dynamically registered preferences to their new home in a statically | |
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 | |
16 // to iterate over a raw DictionaryValue looking for keys to migrate. | |
17 // | |
18 // Objects of this class delete themselves after the migration. | |
19 // | |
20 // TODO(dgrogan): Delete this for m41. See http://crbug.com/167256. | |
21 | |
22 class BrowserUIPrefsMigrationObserver : public PrefStore::Observer { | |
Bernhard Bauer
2014/09/10 09:15:47
Class name and file name should correspond, to mak
gab
2014/09/10 14:40:04
+1 on keeping the specific name (BrowserUIPrefsMig
dgrogan
2014/09/10 23:09:59
Done.
dgrogan
2014/09/10 23:10:00
Done.
| |
23 public: | |
24 explicit BrowserUIPrefsMigrationObserver( | |
25 scoped_refptr<WriteablePrefStore> pref_store); | |
26 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE {} | |
Bernhard Bauer
2014/09/10 09:15:47
Add a blank line before these methods, followed by
dgrogan
2014/09/10 23:09:59
Done.
| |
27 virtual void OnInitializationCompleted(bool succeeded) OVERRIDE; | |
28 | |
29 private: | |
30 friend struct base::DefaultDeleter<BrowserUIPrefsMigrationObserver>; | |
gab
2014/09/10 14:40:04
Meh.. this also lets anybody own this and delete i
dgrogan
2014/09/10 23:09:59
Acknowledged.
| |
31 | |
32 virtual ~BrowserUIPrefsMigrationObserver(); | |
33 | |
34 scoped_refptr<WriteablePrefStore> pref_store_; | |
gab
2014/09/10 14:40:04
Use a weak pointer here; the PrefStore shouldn't *
dgrogan
2014/09/10 23:09:59
Switched to raw.
| |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(BrowserUIPrefsMigrationObserver); | |
37 }; | |
38 | |
39 #endif // CHROME_BROWSER_UI_PREFS_MIGRATOR_H_ | |
OLD | NEW |