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_ZOOM_ZOOM_LEVEL_PREFS_DELEGATE_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_LEVEL_PREFS_DELEGATE_IMPL_H_ |
| 7 |
| 8 #include "content/public/browser/zoom_level_prefs_delegate.h" |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/prefs/json_pref_store.h" |
| 13 #include "base/prefs/pref_store.h" |
| 14 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 15 #include "content/public/browser/host_zoom_map.h" |
| 16 |
| 17 namespace browser { |
| 18 |
| 19 class ZoomLevelPrefsDelegateImpl : public PrefStore::Observer, |
| 20 public content::ZoomLevelPrefsDelegate { |
| 21 public: |
| 22 ZoomLevelPrefsDelegateImpl(); |
| 23 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); |
| 24 |
| 25 // Implement ZoomLevelPrefsDelegate. |
| 26 virtual void InitZoomLevels(const base::FilePath& file_path, |
| 27 content::HostZoomMap* host_zoom_map) OVERRIDE; |
| 28 virtual PrefService* GetPrefs() OVERRIDE; |
| 29 |
| 30 // Implement PrefObserver. |
| 31 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE; |
| 32 virtual void OnInitializationCompleted(bool succeeded) OVERRIDE; |
| 33 |
| 34 private: |
| 35 virtual ~ZoomLevelPrefsDelegateImpl(); |
| 36 |
| 37 scoped_refptr<JsonPrefStore> zoom_level_prefs_; |
| 38 scoped_ptr<PrefServiceSyncable> pref_service_; |
| 39 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 40 content::HostZoomMap* host_zoom_map_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(ZoomLevelPrefsDelegateImpl); |
| 43 }; |
| 44 |
| 45 } // namespace browser |
| 46 |
| 47 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_LEVEL_PREFS_DELEGATE_IMPL_H_ |
OLD | NEW |