Rename HostZoomMap::GetForBrowserContext() to GetDefaultForBrowserContext().
HostZoomMap will be moving from BrowserContext to StoragePartition soon
as part of fixing this bug. Many sites will still want to access the
default HostZoomMap for a BrowserContext, so we will rename this
function in order to be clear about that.
BUG=335317
Review URL: https://codereview.chromium.org/506073002
Cr-Commit-Position: refs/heads/master@{#292147}
diff --git a/content/browser/host_zoom_map_impl.cc b/content/browser/host_zoom_map_impl.cc
index e40736a..9c595ef 100644
--- a/content/browser/host_zoom_map_impl.cc
+++ b/content/browser/host_zoom_map_impl.cc
@@ -48,7 +48,7 @@
} // namespace
-HostZoomMap* HostZoomMap::GetForBrowserContext(BrowserContext* context) {
+HostZoomMap* HostZoomMap::GetDefaultForBrowserContext(BrowserContext* context) {
HostZoomMapImpl* rv = static_cast<HostZoomMapImpl*>(
context->GetUserData(kHostZoomMapKeyName));
if (!rv) {
@@ -61,15 +61,17 @@
// Helper function for setting/getting zoom levels for WebContents without
// having to import HostZoomMapImpl everywhere.
double HostZoomMap::GetZoomLevel(const WebContents* web_contents) {
- HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>(
- HostZoomMap::GetForBrowserContext(web_contents->GetBrowserContext()));
+ HostZoomMapImpl* host_zoom_map =
+ static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext(
+ web_contents->GetBrowserContext()));
return host_zoom_map->GetZoomLevelForWebContents(
*static_cast<const WebContentsImpl*>(web_contents));
}
void HostZoomMap::SetZoomLevel(const WebContents* web_contents, double level) {
- HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>(
- HostZoomMap::GetForBrowserContext(web_contents->GetBrowserContext()));
+ HostZoomMapImpl* host_zoom_map =
+ static_cast<HostZoomMapImpl*>(HostZoomMap::GetDefaultForBrowserContext(
+ web_contents->GetBrowserContext()));
host_zoom_map->SetZoomLevelForWebContents(
*static_cast<const WebContentsImpl*>(web_contents), level);
}
@@ -374,7 +376,7 @@
for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
RenderProcessHost* render_process_host = i.GetCurrentValue();
- if (HostZoomMap::GetForBrowserContext(
+ if (HostZoomMap::GetDefaultForBrowserContext(
render_process_host->GetBrowserContext()) == this) {
render_process_host->Send(
new ViewMsg_SetZoomLevelForCurrentURL(scheme, host, level));