| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/prefs/pref_change_registrar.h" | 10 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
| 14 | 14 |
| 15 class OverlayUserPrefStore; |
| 15 class PrefService; | 16 class PrefService; |
| 16 class Profile; | 17 class Profile; |
| 17 struct WebPreferences; | 18 struct WebPreferences; |
| 18 | 19 |
| 19 // Per-tab class to handle user preferences. | 20 // Per-tab class to handle user preferences. |
| 20 class PrefsTabHelper : public content::WebContentsObserver, | 21 class PrefsTabHelper : public content::WebContentsObserver, |
| 21 public content::NotificationObserver { | 22 public content::NotificationObserver { |
| 22 public: | 23 public: |
| 23 explicit PrefsTabHelper(content::WebContents* contents); | 24 explicit PrefsTabHelper(content::WebContents* contents); |
| 24 virtual ~PrefsTabHelper(); | 25 virtual ~PrefsTabHelper(); |
| 25 | 26 |
| 27 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store); |
| 28 static void InitPerTabUserPrefStore(OverlayUserPrefStore* pref_store); |
| 26 static void RegisterUserPrefs(PrefService* prefs); | 29 static void RegisterUserPrefs(PrefService* prefs); |
| 27 | 30 |
| 28 PrefService* per_tab_prefs() { return per_tab_prefs_.get(); } | 31 PrefService* per_tab_prefs() { return per_tab_prefs_.get(); } |
| 29 | 32 |
| 30 protected: | 33 protected: |
| 31 // Update the RenderView's WebPreferences. Exposed as protected for testing. | 34 // Update the RenderView's WebPreferences. Exposed as protected for testing. |
| 32 virtual void UpdateWebPreferences(); | 35 virtual void UpdateWebPreferences(); |
| 33 | 36 |
| 34 // content::WebContentsObserver overrides, exposed as protected for testing. | 37 // content::WebContentsObserver overrides, exposed as protected for testing. |
| 35 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 38 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 51 content::NotificationRegistrar registrar_; | 54 content::NotificationRegistrar registrar_; |
| 52 | 55 |
| 53 scoped_ptr<PrefService> per_tab_prefs_; | 56 scoped_ptr<PrefService> per_tab_prefs_; |
| 54 PrefChangeRegistrar pref_change_registrar_; | 57 PrefChangeRegistrar pref_change_registrar_; |
| 55 PrefChangeRegistrar per_tab_pref_change_registrar_; | 58 PrefChangeRegistrar per_tab_pref_change_registrar_; |
| 56 | 59 |
| 57 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); | 60 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ | 63 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ |
| OLD | NEW |