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

Side by Side Diff: chrome/browser/ui/prefs/prefs_tab_helper.h

Issue 8775064: Make PerTabPrefsTabHelper into PrefsTabHelper, move all prefs code into it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: this one instead 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
(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 protected:
29 // Update the RenderView's WebPreferences. Exposed as protected for testing.
30 virtual void UpdateWebPreferences();
31
32 // TabContentsObserver overrides, exposed as protected for testing.
33 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
34
35 private:
36 // TabContentsObserver overrides:
37 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE;
38
39 // content::NotificationObserver overrides:
40 virtual void Observe(int type,
41 const content::NotificationSource& source,
42 const content::NotificationDetails& details) OVERRIDE;
43
44 // Update the TabContents's RendererPreferences.
45 void UpdateRendererPreferences();
46
47 // Our owning TabContentsWrapper.
48 TabContentsWrapper* wrapper_;
49
50 content::NotificationRegistrar registrar_;
51
52 scoped_ptr<PrefService> per_tab_prefs_;
53 PrefChangeRegistrar pref_change_registrar_;
54 PrefChangeRegistrar per_tab_pref_change_registrar_;
55
56 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper);
57 };
58
59 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698