| Index: chrome/browser/profiles/profile_impl.cc
|
| diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
|
| index 695e92e9f2c79145d89e436bcff37e1636172aaf..b35b92a6cd904041c9784a1d1cf0a8ba887c9d46 100644
|
| --- a/chrome/browser/profiles/profile_impl.cc
|
| +++ b/chrome/browser/profiles/profile_impl.cc
|
| @@ -568,8 +568,7 @@ void ProfileImpl::InitHostZoomMap() {
|
| }
|
| }
|
|
|
| - registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
|
| - content::Source<HostZoomMap>(host_zoom_map));
|
| + content::HostZoomMap::Observer::Observe(host_zoom_map);
|
| }
|
|
|
| FilePath ProfileImpl::last_selected_directory() {
|
| @@ -914,6 +913,21 @@ history::TopSites* ProfileImpl::GetTopSitesWithoutCreating() {
|
| return top_sites_;
|
| }
|
|
|
| +void ProfileImpl::OnZoomLevelChanged(const std::string& host) {
|
| + if (host.empty())
|
| + return;
|
| + HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this);
|
| + double level = host_zoom_map->GetZoomLevel(host);
|
| + DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels);
|
| + DictionaryValue* host_zoom_dictionary = update.Get();
|
| + if (level == host_zoom_map->GetDefaultZoomLevel()) {
|
| + host_zoom_dictionary->RemoveWithoutPathExpansion(host, NULL);
|
| + } else {
|
| + host_zoom_dictionary->SetWithoutPathExpansion(
|
| + host, Value::CreateDoubleValue(level));
|
| + }
|
| +}
|
| +
|
| void ProfileImpl::Observe(int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| @@ -924,23 +938,6 @@ void ProfileImpl::Observe(int type,
|
| registrar_.Remove(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED,
|
| content::Source<Profile>(this));
|
| break;
|
| - case content::NOTIFICATION_ZOOM_LEVEL_CHANGED: {
|
| - const std::string& host =
|
| - *(content::Details<const std::string>(details).ptr());
|
| - if (!host.empty()) {
|
| - HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this);
|
| - double level = host_zoom_map->GetZoomLevel(host);
|
| - DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels);
|
| - DictionaryValue* host_zoom_dictionary = update.Get();
|
| - if (level == host_zoom_map->GetDefaultZoomLevel()) {
|
| - host_zoom_dictionary->RemoveWithoutPathExpansion(host, NULL);
|
| - } else {
|
| - host_zoom_dictionary->SetWithoutPathExpansion(
|
| - host, Value::CreateDoubleValue(level));
|
| - }
|
| - }
|
| - break;
|
| - }
|
| default:
|
| NOTREACHED();
|
| }
|
|
|