blob: ffab13bb0667a43e9bab8f4e3a8dc0a47997890b [file] [log] [blame]
[email protected]32c3c752012-01-05 17:33:471// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]9ce7cb42011-12-07 18:53:072// 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
[email protected]71fde352011-12-29 03:29:569#include "base/memory/scoped_ptr.h"
[email protected]9ce7cb42011-12-07 18:53:0710#include "chrome/browser/prefs/pref_change_registrar.h"
[email protected]71fde352011-12-29 03:29:5611#include "content/public/browser/notification_observer.h"
[email protected]9ce7cb42011-12-07 18:53:0712#include "content/public/browser/notification_registrar.h"
13
[email protected]32c3c752012-01-05 17:33:4714class OverlayUserPrefStore;
[email protected]9ce7cb42011-12-07 18:53:0715class PrefService;
[email protected]ea6ad01a2011-12-21 21:53:4916class Profile;
[email protected]9ce7cb42011-12-07 18:53:0717struct WebPreferences;
18
[email protected]d0aa78d2012-03-26 07:55:0219namespace content {
20class WebContents;
21}
22
[email protected]9ce7cb42011-12-07 18:53:0723// Per-tab class to handle user preferences.
[email protected]d0aa78d2012-03-26 07:55:0224class PrefsTabHelper : public content::NotificationObserver {
[email protected]9ce7cb42011-12-07 18:53:0725 public:
[email protected]768c5472011-12-26 19:06:1726 explicit PrefsTabHelper(content::WebContents* contents);
[email protected]9ce7cb42011-12-07 18:53:0727 virtual ~PrefsTabHelper();
28
[email protected]32c3c752012-01-05 17:33:4729 static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store);
[email protected]9ce7cb42011-12-07 18:53:0730 static void RegisterUserPrefs(PrefService* prefs);
31
[email protected]9ce7cb42011-12-07 18:53:0732 protected:
33 // Update the RenderView's WebPreferences. Exposed as protected for testing.
34 virtual void UpdateWebPreferences();
35
[email protected]9ce7cb42011-12-07 18:53:0736 private:
[email protected]9ce7cb42011-12-07 18:53:0737 // content::NotificationObserver overrides:
38 virtual void Observe(int type,
39 const content::NotificationSource& source,
40 const content::NotificationDetails& details) OVERRIDE;
41
42 // Update the TabContents's RendererPreferences.
43 void UpdateRendererPreferences();
44
[email protected]ea6ad01a2011-12-21 21:53:4945 Profile* GetProfile();
46
[email protected]d0aa78d2012-03-26 07:55:0247 content::WebContents* web_contents_;
[email protected]9ce7cb42011-12-07 18:53:0748 content::NotificationRegistrar registrar_;
[email protected]9ce7cb42011-12-07 18:53:0749 PrefChangeRegistrar pref_change_registrar_;
[email protected]9ce7cb42011-12-07 18:53:0750
51 DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper);
52};
53
54#endif // CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_