Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1034)

Side by Side Diff: chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h

Issue 8747015: Apply per-tab preference after RenderViewImpl creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_ 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_ 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/prefs/pref_change_registrar.h" 9 #include "chrome/browser/prefs/pref_change_registrar.h"
10 #include "content/browser/tab_contents/tab_contents_observer.h" 10 #include "content/browser/tab_contents/tab_contents_observer.h"
11 11
12 class PrefService; 12 class PrefService;
13 class TabContentsWrapper; 13 class TabContentsWrapper;
14 struct WebPreferences; 14 struct WebPreferences;
15 15
16 // Per-tab class to override user preferences. 16 // Per-tab class to override user preferences.
17 class PerTabPrefsTabHelper : public TabContentsObserver { 17 class PerTabPrefsTabHelper : public TabContentsObserver {
18 public: 18 public:
19 explicit PerTabPrefsTabHelper(TabContentsWrapper* tab_contents); 19 explicit PerTabPrefsTabHelper(TabContentsWrapper* tab_contents);
20 virtual ~PerTabPrefsTabHelper(); 20 virtual ~PerTabPrefsTabHelper();
21 21
22 PrefService* prefs() { return prefs_.get(); } 22 PrefService* prefs() { return prefs_.get(); }
23 23
24 void OverrideWebPreferences(WebPreferences* prefs); 24 void OverrideWebPreferences(WebPreferences* prefs);
25 25
26 private: 26 private:
27 void RegisterPerTabUserPrefs(PrefService* prefs); 27 void RegisterPerTabUserPrefs(PrefService* prefs);
28 28
29 // TabContentsObserver overrides: 29 // TabContentsObserver overrides:
30 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
30 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; 31 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE;
31 32
32 // Our owning TabContentsWrapper. 33 // Our owning TabContentsWrapper.
33 TabContentsWrapper* wrapper_; 34 TabContentsWrapper* wrapper_;
34 35
35 scoped_ptr<PrefService> prefs_; 36 scoped_ptr<PrefService> prefs_;
36 PrefChangeRegistrar pref_change_registrar_; 37 PrefChangeRegistrar pref_change_registrar_;
37 38
38 DISALLOW_COPY_AND_ASSIGN(PerTabPrefsTabHelper); 39 DISALLOW_COPY_AND_ASSIGN(PerTabPrefsTabHelper);
39 }; 40 };
40 41
41 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_ 42 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698