| 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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/prefs/public/pref_change_registrar.h" | 9 #include "base/prefs/public/pref_change_registrar.h" |
| 10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 // Per-tab class to handle user preferences. | 23 // Per-tab class to handle user preferences. |
| 24 class PrefsTabHelper : public content::NotificationObserver, | 24 class PrefsTabHelper : public content::NotificationObserver, |
| 25 public content::WebContentsUserData<PrefsTabHelper> { | 25 public content::WebContentsUserData<PrefsTabHelper> { |
| 26 public: | 26 public: |
| 27 virtual ~PrefsTabHelper(); | 27 virtual ~PrefsTabHelper(); |
| 28 | 28 |
| 29 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store); | 29 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store); |
| 30 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 30 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
| 31 static void MigrateUserPrefs(PrefService* prefs, | 31 static void MigrateUserPrefs(PrefService* prefs); |
| 32 PrefRegistrySyncable* registry); | |
| 33 | 32 |
| 34 protected: | 33 protected: |
| 35 // Update the RenderView's WebPreferences. Exposed as protected for testing. | 34 // Update the RenderView's WebPreferences. Exposed as protected for testing. |
| 36 virtual void UpdateWebPreferences(); | 35 virtual void UpdateWebPreferences(); |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 explicit PrefsTabHelper(content::WebContents* contents); | 38 explicit PrefsTabHelper(content::WebContents* contents); |
| 40 friend class content::WebContentsUserData<PrefsTabHelper>; | 39 friend class content::WebContentsUserData<PrefsTabHelper>; |
| 41 | 40 |
| 42 // content::NotificationObserver overrides: | 41 // content::NotificationObserver overrides: |
| 43 virtual void Observe(int type, | 42 virtual void Observe(int type, |
| 44 const content::NotificationSource& source, | 43 const content::NotificationSource& source, |
| 45 const content::NotificationDetails& details) OVERRIDE; | 44 const content::NotificationDetails& details) OVERRIDE; |
| 46 | 45 |
| 47 // Update the WebContents's RendererPreferences. | 46 // Update the WebContents's RendererPreferences. |
| 48 void UpdateRendererPreferences(); | 47 void UpdateRendererPreferences(); |
| 49 | 48 |
| 50 Profile* GetProfile(); | 49 Profile* GetProfile(); |
| 51 void OnWebPrefChanged(const std::string& pref_name); | 50 void OnWebPrefChanged(const std::string& pref_name); |
| 52 | 51 |
| 53 content::WebContents* web_contents_; | 52 content::WebContents* web_contents_; |
| 54 content::NotificationRegistrar registrar_; | 53 content::NotificationRegistrar registrar_; |
| 55 PrefChangeRegistrar pref_change_registrar_; | 54 PrefChangeRegistrar pref_change_registrar_; |
| 56 | 55 |
| 57 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); | 56 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ | 59 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ |
| OLD | NEW |