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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 11866004: Add scheme to HostZoomMap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months 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/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 128197db8db8c7b47a53f5ba27c0ac0145a0aaf9..912a7aaa699ece57aecbf8a4c2d844287cdeac76 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -585,7 +585,7 @@ void ProfileImpl::InitHostZoomMap() {
bool success = host_zoom_dictionary->GetDoubleWithoutPathExpansion(
host, &zoom_level);
DCHECK(success);
- host_zoom_map->SetZoomLevel(host, zoom_level);
+ host_zoom_map->SetZoomLevelForHost(host, zoom_level);
}
}
@@ -981,18 +981,20 @@ void ProfileImpl::OnDefaultZoomLevelChanged() {
pref_change_registrar_.prefs()->GetDouble(prefs::kDefaultZoomLevel));
}
-void ProfileImpl::OnZoomLevelChanged(const std::string& host) {
- if (host.empty())
+void ProfileImpl::OnZoomLevelChanged(
+ const HostZoomMap::ZoomLevelChange& change) {
+
+ if (change.mode != HostZoomMap::ZOOM_CHANGED_FOR_HOST)
return;
HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this);
- double level = host_zoom_map->GetZoomLevel(host);
+ double level = change.zoom_level;
DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels);
DictionaryValue* host_zoom_dictionary = update.Get();
if (level == host_zoom_map->GetDefaultZoomLevel()) {
- host_zoom_dictionary->RemoveWithoutPathExpansion(host, NULL);
+ host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, NULL);
} else {
host_zoom_dictionary->SetWithoutPathExpansion(
- host, Value::CreateDoubleValue(level));
+ change.host, Value::CreateDoubleValue(level));
}
}

Powered by Google App Engine
This is Rietveld 408576698