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

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

Issue 9838050: Remove per-tab preference machinery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: should be kWebKitGlobalJavascriptEnabled Created 8 years, 9 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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"
14 13
15 class OverlayUserPrefStore; 14 class OverlayUserPrefStore;
16 class PrefService; 15 class PrefService;
17 class Profile; 16 class Profile;
18 struct WebPreferences; 17 struct WebPreferences;
19 18
19 namespace content {
20 class WebContents;
21 }
22
20 // Per-tab class to handle user preferences. 23 // Per-tab class to handle user preferences.
21 class PrefsTabHelper : public content::WebContentsObserver, 24 class PrefsTabHelper : public content::NotificationObserver {
22 public content::NotificationObserver {
23 public: 25 public:
24 explicit PrefsTabHelper(content::WebContents* contents); 26 explicit PrefsTabHelper(content::WebContents* contents);
25 virtual ~PrefsTabHelper(); 27 virtual ~PrefsTabHelper();
26 28
27 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store); 29 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store);
28 static void InitPerTabUserPrefStore(OverlayUserPrefStore* pref_store);
29 static void RegisterUserPrefs(PrefService* prefs); 30 static void RegisterUserPrefs(PrefService* prefs);
30 31
31 PrefService* per_tab_prefs() { return per_tab_prefs_.get(); }
32
33 protected: 32 protected:
34 // Update the RenderView's WebPreferences. Exposed as protected for testing. 33 // Update the RenderView's WebPreferences. Exposed as protected for testing.
35 virtual void UpdateWebPreferences(); 34 virtual void UpdateWebPreferences();
36 35
37 // content::WebContentsObserver overrides, exposed as protected for testing.
38 virtual void RenderViewCreated(
39 content::RenderViewHost* render_view_host) OVERRIDE;
40
41 private: 36 private:
42 // content::WebContentsObserver overrides:
43 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
44
45 // content::NotificationObserver overrides: 37 // content::NotificationObserver overrides:
46 virtual void Observe(int type, 38 virtual void Observe(int type,
47 const content::NotificationSource& source, 39 const content::NotificationSource& source,
48 const content::NotificationDetails& details) OVERRIDE; 40 const content::NotificationDetails& details) OVERRIDE;
49 41
50 // Update the TabContents's RendererPreferences. 42 // Update the TabContents's RendererPreferences.
51 void UpdateRendererPreferences(); 43 void UpdateRendererPreferences();
52 44
53 Profile* GetProfile(); 45 Profile* GetProfile();
54 46
47 content::WebContents* web_contents_;
55 content::NotificationRegistrar registrar_; 48 content::NotificationRegistrar registrar_;
56
57 scoped_ptr<PrefService> per_tab_prefs_;
58 PrefChangeRegistrar pref_change_registrar_; 49 PrefChangeRegistrar pref_change_registrar_;
59 PrefChangeRegistrar per_tab_pref_change_registrar_;
60 50
61 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper); 51 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper);
62 }; 52 };
63 53
64 #endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_ 54 #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