| 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_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_ | |
| 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_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 | |
| 12 class PrefService; | |
| 13 class TabContentsWrapper; | |
| 14 struct WebPreferences; | |
| 15 | |
| 16 // Per-tab class to override user preferences. | |
| 17 class PerTabPrefsTabHelper : public TabContentsObserver { | |
| 18 public: | |
| 19 explicit PerTabPrefsTabHelper(TabContentsWrapper* tab_contents); | |
| 20 virtual ~PerTabPrefsTabHelper(); | |
| 21 | |
| 22 PrefService* prefs() { return prefs_.get(); } | |
| 23 | |
| 24 virtual void OverrideWebPreferences(WebPreferences* prefs); | |
| 25 | |
| 26 protected: | |
| 27 void RegisterPerTabUserPrefs(PrefService* prefs); | |
| 28 | |
| 29 // TabContentsObserver overrides: | |
| 30 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | |
| 31 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; | |
| 32 | |
| 33 private: | |
| 34 // Our owning TabContentsWrapper. | |
| 35 TabContentsWrapper* wrapper_; | |
| 36 | |
| 37 scoped_ptr<PrefService> prefs_; | |
| 38 PrefChangeRegistrar pref_change_registrar_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(PerTabPrefsTabHelper); | |
| 41 }; | |
| 42 | |
| 43 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_ | |
| OLD | NEW |