summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-23 18:21:58 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-23 18:21:58 +0000
commit162e3df58563d1dae809980b084bfa706e6832a9 (patch)
tree2c2dae6c629f4ae067ad3cf8b0be2a7015619068 /chrome/browser/profiles
parent05699652b60d05243cf4a3c6f2e2fb6cf88e7a8f (diff)
downloadchromium_src-162e3df58563d1dae809980b084bfa706e6832a9.zip
chromium_src-162e3df58563d1dae809980b084bfa706e6832a9.tar.gz
chromium_src-162e3df58563d1dae809980b084bfa706e6832a9.tar.bz2
Take out pref watching from HostZoomMap, in preparation of removing Profile from it.
I've moved watching changes to the default zoom level to the Profile class. The other value being watched was for the per-hostname level, which is only needed if it's being synced. However this pref stopped being synced in r51849, so the removal is roughly a revert of 44056. Review URL: http://codereview.chromium.org/7058003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profiles')
-rw-r--r--chrome/browser/profiles/profile.cc5
-rw-r--r--chrome/browser/profiles/profile_impl.cc9
2 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index c87666c..e07dafb 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -143,6 +143,11 @@ void Profile::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterStringPref(prefs::kSelectFileLastDirectory,
"",
PrefService::UNSYNCABLE_PREF);
+ prefs->RegisterDoublePref(prefs::kDefaultZoomLevel,
+ 0.0,
+ PrefService::UNSYNCABLE_PREF);
+ prefs->RegisterDictionaryPref(prefs::kPerHostZoomLevels,
+ PrefService::UNSYNCABLE_PREF);
#if defined(OS_CHROMEOS)
// TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both
// local state and user's profile. For other platforms we maintain
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index c50603d..050006c 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -320,6 +320,7 @@ void ProfileImpl::DoFinalInit() {
pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this);
pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this);
+ pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this);
// It would be nice to use PathService for fetching this directory, but
// the cache directory depends on the profile directory, which isn't available
@@ -945,8 +946,11 @@ HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() {
}
HostZoomMap* ProfileImpl::GetHostZoomMap() {
- if (!host_zoom_map_)
+ if (!host_zoom_map_) {
host_zoom_map_ = new HostZoomMap(this);
+ host_zoom_map_->set_default_zoom_level(
+ GetPrefs()->GetDouble(prefs::kDefaultZoomLevel));
+ }
return host_zoom_map_.get();
}
@@ -1359,6 +1363,9 @@ void ProfileImpl::Observe(NotificationType type,
} else if (*pref_name_in == prefs::kGoogleServicesUsername) {
ProfileManager* profile_manager = g_browser_process->profile_manager();
profile_manager->RegisterProfileName(this);
+ } else if (*pref_name_in == prefs::kDefaultZoomLevel) {
+ GetHostZoomMap()->set_default_zoom_level(
+ prefs->GetDouble(prefs::kDefaultZoomLevel));
}
break;
}