Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ | |
| 6 #define CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/prefs/pref_change_registrar.h" | |
| 10 #include "content/browser/tab_contents/tab_contents_observer.h" | |
| 11 #include "content/public/browser/notification_registrar.h" | |
| 12 | |
| 13 class PrefService; | |
| 14 class TabContentsWrapper; | |
| 15 struct WebPreferences; | |
| 16 | |
| 17 // Per-tab class to handle user preferences. | |
| 18 class PrefsTabHelper : public TabContentsObserver, | |
| 19 public content::NotificationObserver { | |
| 20 public: | |
| 21 explicit PrefsTabHelper(TabContentsWrapper* tab_contents); | |
| 22 virtual ~PrefsTabHelper(); | |
| 23 | |
| 24 static void RegisterUserPrefs(PrefService* prefs); | |
| 25 | |
| 26 PrefService* per_tab_prefs() { return per_tab_prefs_.get(); } | |
| 27 | |
| 28 virtual void OverrideWebPreferences(WebPreferences* prefs); | |
|
mnaganov (inactive)
2011/12/02 20:01:32
Doesn't need to be public anymore.
| |
| 29 | |
| 30 protected: | |
|
Jói
2011/12/05 10:25:03
These can be private, unless you plan to let subcl
| |
| 31 // Overrides ----------------------------------------------------------------- | |
| 32 | |
| 33 // TabContentsObserver overrides: | |
| 34 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | |
| 35 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; | |
| 36 | |
| 37 // content::NotificationObserver overrides: | |
| 38 virtual void Observe(int type, | |
| 39 const content::NotificationSource& source, | |
| 40 const content::NotificationDetails& details) OVERRIDE; | |
| 41 | |
| 42 private: | |
| 43 // Update the RenderView's WebPreferences. | |
| 44 void UpdateWebPreferences(); | |
| 45 | |
| 46 // Update the TabContents's RendererPreferences. | |
| 47 void UpdateRendererPreferences(); | |
| 48 | |
| 49 // Our owning TabContentsWrapper. | |
| 50 TabContentsWrapper* wrapper_; | |
| 51 | |
| 52 content::NotificationRegistrar registrar_; | |
| 53 | |
| 54 scoped_ptr<PrefService> per_tab_prefs_; | |
| 55 PrefChangeRegistrar pref_change_registrar_; | |
| 56 PrefChangeRegistrar per_tab_pref_change_registrar_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); | |
| 59 }; | |
| 60 | |
| 61 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ | |
| OLD | NEW |