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

Unified Diff: chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h

Issue 8716004: Add per-tab "JavaScript enabled" preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and fixed fwd declaration Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h
diff --git a/chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h b/chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..5784dd145177475e2020435200b2c63c61d4675a
--- /dev/null
+++ b/chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_
+#define CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_
+#pragma once
+
+#include "chrome/browser/prefs/pref_change_registrar.h"
+#include "content/browser/tab_contents/tab_contents_observer.h"
+
+class PrefService;
+class TabContentsWrapper;
+struct WebPreferences;
+
+// Per-tab class to override user preferences.
+class PerTabPrefsTabHelper : public TabContentsObserver {
+ public:
+ explicit PerTabPrefsTabHelper(TabContentsWrapper* tab_contents);
+ virtual ~PerTabPrefsTabHelper();
+
+ PrefService* prefs() { return prefs_.get(); }
+
+ void OverrideWebPreferences(WebPreferences* prefs);
+
+ private:
+ void RegisterPerTabUserPrefs(PrefService* prefs);
+
+ // TabContentsObserver overrides:
+ virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE;
+
+ // Our owning TabContentsWrapper.
+ TabContentsWrapper* wrapper_;
+
+ scoped_ptr<PrefService> prefs_;
+ PrefChangeRegistrar pref_change_registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerTabPrefsTabHelper);
+};
+
+#endif // CHROME_BROWSER_UI_TAB_CONTENTS_PER_TAB_PREFS_TAB_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698