| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_PREFS_PREFS_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/callback_list.h" | 8 #include "base/callback_list.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace user_prefs { | 25 namespace user_prefs { |
| 26 class PrefRegistrySyncable; | 26 class PrefRegistrySyncable; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Per-tab class to handle user preferences. | 29 // Per-tab class to handle user preferences. |
| 30 class PrefsTabHelper : public content::NotificationObserver, | 30 class PrefsTabHelper : public content::NotificationObserver, |
| 31 public content::WebContentsUserData<PrefsTabHelper> { | 31 public content::WebContentsUserData<PrefsTabHelper> { |
| 32 public: | 32 public: |
| 33 virtual ~PrefsTabHelper(); | 33 ~PrefsTabHelper() override; |
| 34 | 34 |
| 35 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store); | 35 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store); |
| 36 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 36 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 // Update the RenderView's WebPreferences. Exposed as protected for testing. | 39 // Update the RenderView's WebPreferences. Exposed as protected for testing. |
| 40 virtual void UpdateWebPreferences(); | 40 virtual void UpdateWebPreferences(); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 explicit PrefsTabHelper(content::WebContents* contents); | 43 explicit PrefsTabHelper(content::WebContents* contents); |
| 44 friend class content::WebContentsUserData<PrefsTabHelper>; | 44 friend class content::WebContentsUserData<PrefsTabHelper>; |
| 45 | 45 |
| 46 // content::NotificationObserver overrides: | 46 // content::NotificationObserver overrides: |
| 47 virtual void Observe(int type, | 47 void Observe(int type, |
| 48 const content::NotificationSource& source, | 48 const content::NotificationSource& source, |
| 49 const content::NotificationDetails& details) override; | 49 const content::NotificationDetails& details) override; |
| 50 | 50 |
| 51 // Update the WebContents's RendererPreferences. | 51 // Update the WebContents's RendererPreferences. |
| 52 void UpdateRendererPreferences(); | 52 void UpdateRendererPreferences(); |
| 53 | 53 |
| 54 Profile* GetProfile(); | 54 Profile* GetProfile(); |
| 55 | 55 |
| 56 void OnFontFamilyPrefChanged(const std::string& pref_name); | 56 void OnFontFamilyPrefChanged(const std::string& pref_name); |
| 57 void OnWebPrefChanged(const std::string& pref_name); | 57 void OnWebPrefChanged(const std::string& pref_name); |
| 58 | 58 |
| 59 content::WebContents* web_contents_; | 59 content::WebContents* web_contents_; |
| 60 content::NotificationRegistrar registrar_; | 60 content::NotificationRegistrar registrar_; |
| 61 PrefChangeRegistrar pref_change_registrar_; | 61 PrefChangeRegistrar pref_change_registrar_; |
| 62 scoped_ptr<base::CallbackList<void(void)>::Subscription> | 62 scoped_ptr<base::CallbackList<void(void)>::Subscription> |
| 63 style_sheet_subscription_; | 63 style_sheet_subscription_; |
| 64 scoped_ptr<chrome::ChromeZoomLevelPrefs::DefaultZoomLevelSubscription> | 64 scoped_ptr<chrome::ChromeZoomLevelPrefs::DefaultZoomLevelSubscription> |
| 65 default_zoom_level_subscription_; | 65 default_zoom_level_subscription_; |
| 66 base::WeakPtrFactory<PrefsTabHelper> weak_ptr_factory_; | 66 base::WeakPtrFactory<PrefsTabHelper> weak_ptr_factory_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); | 68 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ | 71 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ |
| OLD | NEW |