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

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

Issue 10828143: Zoom level limits must be set before setting a zoom level. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 if (!item.isNull()) { 1409 if (!item.isNull()) {
1410 params.content_state = webkit_glue::HistoryItemToString(item); 1410 params.content_state = webkit_glue::HistoryItemToString(item);
1411 } else { 1411 } else {
1412 params.content_state = 1412 params.content_state =
1413 webkit_glue::CreateHistoryStateForURL(GURL(request.url())); 1413 webkit_glue::CreateHistoryStateForURL(GURL(request.url()));
1414 } 1414 }
1415 1415
1416 if (!frame->parent()) { 1416 if (!frame->parent()) {
1417 // Top-level navigation. 1417 // Top-level navigation.
1418 1418
1419 // Reset the zoom limits in case a plugin had changed them previously. This
1420 // will also call us back which will cause us to send a message to
1421 // update WebContentsImpl.
1422 webview()->zoomLimitsChanged(
1423 WebView::zoomFactorToZoomLevel(content::kMinimumZoomFactor),
1424 WebView::zoomFactorToZoomLevel(content::kMaximumZoomFactor));
1425
1419 // Set zoom level, but don't do it for full-page plugin since they don't use 1426 // Set zoom level, but don't do it for full-page plugin since they don't use
1420 // the same zoom settings. 1427 // the same zoom settings.
1421 HostZoomLevels::iterator host_zoom = 1428 HostZoomLevels::iterator host_zoom =
1422 host_zoom_levels_.find(GURL(request.url())); 1429 host_zoom_levels_.find(GURL(request.url()));
1423 if (webview()->mainFrame()->document().isPluginDocument()) { 1430 if (webview()->mainFrame()->document().isPluginDocument()) {
1424 // Reset the zoom levels for plugins. 1431 // Reset the zoom levels for plugins.
1425 webview()->setZoomLevel(false, 0); 1432 webview()->setZoomLevel(false, 0);
1426 } else { 1433 } else {
1427 if (host_zoom != host_zoom_levels_.end()) 1434 if (host_zoom != host_zoom_levels_.end())
1428 webview()->setZoomLevel(false, host_zoom->second); 1435 webview()->setZoomLevel(false, host_zoom->second);
1429 } 1436 }
1430 1437
1431 if (host_zoom != host_zoom_levels_.end()) { 1438 if (host_zoom != host_zoom_levels_.end()) {
1432 // This zoom level was merely recorded transiently for this load. We can 1439 // This zoom level was merely recorded transiently for this load. We can
1433 // erase it now. If at some point we reload this page, the browser will 1440 // erase it now. If at some point we reload this page, the browser will
1434 // send us a new, up-to-date zoom level. 1441 // send us a new, up-to-date zoom level.
1435 host_zoom_levels_.erase(host_zoom); 1442 host_zoom_levels_.erase(host_zoom);
1436 } 1443 }
1437 1444
1438 // Reset the zoom limits in case a plugin had changed them previously. This
1439 // will also call us back which will cause us to send a message to
1440 // update WebContentsImpl.
1441 webview()->zoomLimitsChanged(
1442 WebView::zoomFactorToZoomLevel(content::kMinimumZoomFactor),
1443 WebView::zoomFactorToZoomLevel(content::kMaximumZoomFactor));
1444
1445 // Update contents MIME type for main frame. 1445 // Update contents MIME type for main frame.
1446 params.contents_mime_type = ds->response().mimeType().utf8(); 1446 params.contents_mime_type = ds->response().mimeType().utf8();
1447 1447
1448 params.transition = navigation_state->transition_type(); 1448 params.transition = navigation_state->transition_type();
1449 if (!content::PageTransitionIsMainFrame(params.transition)) { 1449 if (!content::PageTransitionIsMainFrame(params.transition)) {
1450 // If the main frame does a load, it should not be reported as a subframe 1450 // If the main frame does a load, it should not be reported as a subframe
1451 // navigation. This can occur in the following case: 1451 // navigation. This can occur in the following case:
1452 // 1. You're on a site with frames. 1452 // 1. You're on a site with frames.
1453 // 2. You do a subframe navigation. This is stored with transition type 1453 // 2. You do a subframe navigation. This is stored with transition type
1454 // MANUAL_SUBFRAME. 1454 // MANUAL_SUBFRAME.
(...skipping 4312 matching lines...) Expand 10 before | Expand all | Expand 10 after
5767 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5767 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5768 return !!RenderThreadImpl::current()->compositor_thread(); 5768 return !!RenderThreadImpl::current()->compositor_thread();
5769 } 5769 }
5770 5770
5771 void RenderViewImpl::OnJavaBridgeInit() { 5771 void RenderViewImpl::OnJavaBridgeInit() {
5772 DCHECK(!java_bridge_dispatcher_); 5772 DCHECK(!java_bridge_dispatcher_);
5773 #if defined(ENABLE_JAVA_BRIDGE) 5773 #if defined(ENABLE_JAVA_BRIDGE)
5774 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5774 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5775 #endif 5775 #endif
5776 } 5776 }
OLDNEW
« content/renderer/render_view_browsertest.cc ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698