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

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

Issue 17830003: Reset page scale factor to 1.0f on new page navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move page scale override call to RenderViewImpl::ProcessViewLayoutFlags() Created 7 years, 5 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
« 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 (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 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3513 bool enable_fixed_layout = 3513 bool enable_fixed_layout =
3514 command_line.HasSwitch(switches::kEnableFixedLayout); 3514 command_line.HasSwitch(switches::kEnableFixedLayout);
3515 3515
3516 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); 3516 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport);
3517 3517
3518 // If viewport tag is enabled, then the WebKit side will take care 3518 // If viewport tag is enabled, then the WebKit side will take care
3519 // of setting the fixed layout size and page scale limits. 3519 // of setting the fixed layout size and page scale limits.
3520 if (enable_viewport) 3520 if (enable_viewport)
3521 return; 3521 return;
3522 3522
3523 // When navigating to a new page, reset the page scale factor to be 1.0.
3524 webview()->setInitialPageScaleOverride(1.f);
3525
3523 if (enable_fixed_layout) { 3526 if (enable_fixed_layout) {
3524 std::string str = 3527 std::string str =
3525 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); 3528 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout);
3526 std::vector<std::string> tokens; 3529 std::vector<std::string> tokens;
3527 base::SplitString(str, ',', &tokens); 3530 base::SplitString(str, ',', &tokens);
3528 if (tokens.size() == 2) { 3531 if (tokens.size() == 2) {
3529 int width, height; 3532 int width, height;
3530 if (base::StringToInt(tokens[0], &width) && 3533 if (base::StringToInt(tokens[0], &width) &&
3531 base::StringToInt(tokens[1], &height)) 3534 base::StringToInt(tokens[1], &height))
3532 webview()->setFixedLayoutSize(WebSize(width, height)); 3535 webview()->setFixedLayoutSize(WebSize(width, height));
3533 } 3536 }
3534 } 3537 }
3535 float maxPageScaleFactor = 3538 float maxPageScaleFactor =
3536 command_line.HasSwitch(switches::kEnablePinch) ? 4.f : 1.f ; 3539 command_line.HasSwitch(switches::kEnablePinch) ? 4.f : 1.f ;
3537 webview()->setPageScaleFactorLimits(1, maxPageScaleFactor); 3540 webview()->setPageScaleFactorLimits(1, maxPageScaleFactor);
aelias_OOO_until_Jul13 2013/06/27 00:14:59 nit: move the call here as the two calls are relat
3538 } 3541 }
3539 3542
3540 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { 3543 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) {
3541 WebDataSource* ds = frame->provisionalDataSource(); 3544 WebDataSource* ds = frame->provisionalDataSource();
3542 3545
3543 // In fast/loader/stop-provisional-loads.html, we abort the load before this 3546 // In fast/loader/stop-provisional-loads.html, we abort the load before this
3544 // callback is invoked. 3547 // callback is invoked.
3545 if (!ds) 3548 if (!ds)
3546 return; 3549 return;
3547 3550
(...skipping 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after
6765 WebURL url = icon_urls[i].iconURL(); 6768 WebURL url = icon_urls[i].iconURL();
6766 if (!url.isEmpty()) 6769 if (!url.isEmpty())
6767 urls.push_back(FaviconURL(url, 6770 urls.push_back(FaviconURL(url,
6768 ToFaviconType(icon_urls[i].iconType()))); 6771 ToFaviconType(icon_urls[i].iconType())));
6769 } 6772 }
6770 SendUpdateFaviconURL(urls); 6773 SendUpdateFaviconURL(urls);
6771 } 6774 }
6772 6775
6773 6776
6774 } // namespace content 6777 } // 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