Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index b02984b877e81175d44226033125e7bff05f4c42..ac63bd11d34ad075f74210da537e3865922ca994 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -346,7 +346,6 @@ WebContentsImpl::WebContentsImpl( |
closed_by_user_gesture_(false), |
minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), |
maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), |
- temporary_zoom_settings_(false), |
totalPinchGestureAmount_(0), |
currentPinchZoomStepDelta_(0), |
render_view_message_source_(NULL), |
@@ -2170,7 +2169,7 @@ double WebContentsImpl::GetZoomLevel() const { |
return 0; |
double zoom_level; |
- if (temporary_zoom_settings_) { |
+ if (GetRenderManager()->current_host()->uses_temporary_zoom_settings()) { |
Fady Samuel
2014/05/15 23:26:53
GetRenderViewHost()
wjmaclean
2014/05/16 01:57:08
Done.
|
zoom_level = zoom_map->GetTemporaryZoomLevel( |
GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); |
} else { |
@@ -2278,7 +2277,23 @@ bool WebContentsImpl::IsSubframe() const { |
} |
void WebContentsImpl::SetZoomLevel(double level) { |
- Send(new ViewMsg_SetZoomLevel(GetRoutingID(), level)); |
+ HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>( |
+ HostZoomMap::GetForBrowserContext(GetBrowserContext())); |
+ DCHECK(host_zoom_map); |
+ RenderViewHostImpl* host = GetRenderManager()->current_host(); |
Fady Samuel
2014/05/15 23:26:53
GetRenderViewHost()
wjmaclean
2014/05/16 01:57:08
Done.
wjmaclean
2014/05/16 12:53:46
Ooops, just realized that GetRenderViewHost() retu
|
+ |
+ if (host->uses_temporary_zoom_settings()) { |
Fady Samuel
2014/05/16 19:20:07
Can we move this flag to HostZoomMap?
wjmaclean
2014/05/16 19:32:49
I'll look into this. Presumably it becomes part of
|
+ int render_process_id = GetRenderProcessHost()->GetID(); |
+ int render_view_id = host->GetRoutingID(); |
+ host_zoom_map->SetTemporaryZoomLevel( |
+ render_process_id, render_view_id, level); |
+ } else { |
+ host_zoom_map->SetZoomLevelForHost( |
+ net::GetHostOrSpecFromURL(GetLastCommittedURL()), level); |
+ } |
+ |
+ // TODO(wjmaclean) See if it's possible to move the following |
+ // code into HostZoomMap. That way we could eliminate this function entirely. |
BrowserPluginEmbedder* embedder = GetBrowserPluginEmbedder(); |
Fady Samuel
2014/05/15 23:26:53
If this is the main blocker to major code cleanup
wjmaclean
2014/05/16 01:57:08
Yes, I'd like to simplify by doing the final remov
Fady Samuel
2014/05/16 19:20:07
Can we do that in this CL? This CL doesn't seem pa
wjmaclean
2014/05/16 19:32:49
Yes we can do that in this CL. I had just thought
|
if (embedder) |
embedder->SetZoomLevel(level); |
@@ -2630,11 +2645,9 @@ void WebContentsImpl::OnGoToEntryAtOffset(int offset) { |
} |
void WebContentsImpl::OnUpdateZoomLimits(int minimum_percent, |
- int maximum_percent, |
- bool remember) { |
+ int maximum_percent) { |
minimum_zoom_percent_ = minimum_percent; |
maximum_zoom_percent_ = maximum_percent; |
- temporary_zoom_settings_ = !remember; |
} |
void WebContentsImpl::OnEnumerateDirectory(int request_id, |