#ifndef CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_
#define CHROME_BROWSER_UI_PREFS_PREFS_TAB_HELPER_H_
#include "base/callback_list.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "base/prefs/pref_change_registrar.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_user_data.h"
class OverlayUserPrefStore;
class PrefService;
class Profile;
namespace content {
class WebContents;
}
namespace user_prefs {
class PrefRegistrySyncable;
}
class PrefsTabHelper : public content::NotificationObserver,
                       public content::WebContentsUserData<PrefsTabHelper> {
 public:
  virtual ~PrefsTabHelper();
  static void InitIncognitoUserPrefStore(OverlayUserPrefStore* pref_store);
  static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
 protected:
  
  virtual void UpdateWebPreferences();
 private:
  explicit PrefsTabHelper(content::WebContents* contents);
  friend class content::WebContentsUserData<PrefsTabHelper>;
  
  virtual void Observe(int type,
                       const content::NotificationSource& source,
                       const content::NotificationDetails& details) OVERRIDE;
  
  void UpdateRendererPreferences();
  Profile* GetProfile();
  void OnWebPrefChanged(const std::string& pref_name);
  content::WebContents* web_contents_;
  content::NotificationRegistrar registrar_;
  PrefChangeRegistrar pref_change_registrar_;
  scoped_ptr<base::CallbackList<void(void)>::Subscription>
      style_sheet_subscription_;
  base::WeakPtrFactory<PrefsTabHelper> weak_ptr_factory_;
  DISALLOW_COPY_AND_ASSIGN(PrefsTabHelper);
};
#endif