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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 663203002: Force reset of RenderViewImpl zoom level. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after
3367 ZoomFactorToZoomLevel(kMaximumZoomFactor)); 3367 ZoomFactorToZoomLevel(kMaximumZoomFactor));
3368 3368
3369 // Set zoom level, but don't do it for full-page plugin since they don't use 3369 // Set zoom level, but don't do it for full-page plugin since they don't use
3370 // the same zoom settings. 3370 // the same zoom settings.
3371 HostZoomLevels::iterator host_zoom = 3371 HostZoomLevels::iterator host_zoom =
3372 render_view_->host_zoom_levels_.find(GURL(request.url())); 3372 render_view_->host_zoom_levels_.find(GURL(request.url()));
3373 if (render_view_->webview()->mainFrame()->document().isPluginDocument()) { 3373 if (render_view_->webview()->mainFrame()->document().isPluginDocument()) {
3374 // Reset the zoom levels for plugins. 3374 // Reset the zoom levels for plugins.
3375 render_view_->webview()->setZoomLevel(0); 3375 render_view_->webview()->setZoomLevel(0);
3376 } else { 3376 } else {
3377 if (host_zoom != render_view_->host_zoom_levels_.end()) 3377 if (host_zoom != render_view_->host_zoom_levels_.end()) {
3378 render_view_->webview()->setZoomLevel(host_zoom->second); 3378 render_view_->webview()->setZoomLevel(host_zoom->second);
3379 } else {
3380 // If the url was not found, we need to reset in case we are re-using
3381 // an existing RenderViewImpl, e.g. to show a network error page.
3382 render_view_->webview()->setZoomLevel(0);
3383 }
3379 } 3384 }
3380 3385
3381 if (host_zoom != render_view_->host_zoom_levels_.end()) { 3386 if (host_zoom != render_view_->host_zoom_levels_.end()) {
3382 // This zoom level was merely recorded transiently for this load. We can 3387 // This zoom level was merely recorded transiently for this load. We can
3383 // erase it now. If at some point we reload this page, the browser will 3388 // erase it now. If at some point we reload this page, the browser will
3384 // send us a new, up-to-date zoom level. 3389 // send us a new, up-to-date zoom level.
3385 render_view_->host_zoom_levels_.erase(host_zoom); 3390 render_view_->host_zoom_levels_.erase(host_zoom);
3386 } 3391 }
3387 3392
3388 // Update contents MIME type for main frame. 3393 // Update contents MIME type for main frame.
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
4073 4078
4074 #if defined(ENABLE_BROWSER_CDMS) 4079 #if defined(ENABLE_BROWSER_CDMS)
4075 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4080 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4076 if (!cdm_manager_) 4081 if (!cdm_manager_)
4077 cdm_manager_ = new RendererCdmManager(this); 4082 cdm_manager_ = new RendererCdmManager(this);
4078 return cdm_manager_; 4083 return cdm_manager_;
4079 } 4084 }
4080 #endif // defined(ENABLE_BROWSER_CDMS) 4085 #endif // defined(ENABLE_BROWSER_CDMS)
4081 4086
4082 } // namespace content 4087 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698