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

Side by Side Diff: chrome/browser/ui/zoom/zoom_level_prefs_store_impl.h

Issue 541103002: Introduce ChromeZoomLevelPref, make zoom level prefs independent of profile prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to fix scoped_refptr conversion. 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 unified diff | Download patch
OLDNEW
(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_ZOOM_ZOOM_LEVEL_PREFS_STORE_IMPL_H_
6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_LEVEL_PREFS_STORE_IMPL_H_
7
8 #include "content/public/browser/zoom_level_prefs_store.h"
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/prefs/json_pref_store.h"
14 #include "base/prefs/pref_store.h"
15 #include "chrome/browser/prefs/pref_service_syncable.h"
16 #include "content/public/browser/host_zoom_map.h"
17
18 namespace chrome {
19
20 // A class to implement ZoomLevelPrefsStore. It also implements
21 // PrefStore::Observer so that it can track changes to the prefs.
22 // Finally, the prefs are also updated in response to zoom events
23 // from HostZoomMap.
24 class ZoomLevelPrefsStoreImpl : public PrefStore::Observer,
25 public content::ZoomLevelPrefsStore {
26 public:
27 ZoomLevelPrefsStoreImpl();
28 virtual ~ZoomLevelPrefsStoreImpl();
29 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change);
sky 2014/09/05 19:28:07 nit: newline between 28/29. Why is this public?
wjmaclean 2014/09/05 21:01:47 Done.
30
31 // Implement ZoomLevelPrefsStore.
32 virtual void InitPrefsAndCopyToHostZoomMap(
33 const base::FilePath& file_path,
34 content::HostZoomMap* host_zoom_map) OVERRIDE;
35 virtual PrefService* GetPrefs() OVERRIDE;
36
37 // Implement PrefObserver.
38 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE;
39 virtual void OnInitializationCompleted(bool succeeded) OVERRIDE;
40
41 // TODO(wjmaclean): remove this when migration is complete.
42 virtual void SetInitCallback(const base::Closure& callback);
43
44 private:
45
sky 2014/09/05 19:28:07 nit: remove newline.
wjmaclean 2014/09/05 21:01:47 Done.
46 base::Closure callback_;
47 scoped_refptr<JsonPrefStore> zoom_level_prefs_;
48 scoped_ptr<PrefServiceSyncable> pref_service_;
49 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_;
50 content::HostZoomMap* host_zoom_map_;
51
52 DISALLOW_COPY_AND_ASSIGN(ZoomLevelPrefsStoreImpl);
53 };
54
55 } // namespace chrome
56
57 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_LEVEL_PREFS_STORE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698