OLD | NEW |
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 3528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3539 bool enable_fixed_layout = | 3539 bool enable_fixed_layout = |
3540 command_line.HasSwitch(switches::kEnableFixedLayout); | 3540 command_line.HasSwitch(switches::kEnableFixedLayout); |
3541 | 3541 |
3542 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); | 3542 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); |
3543 | 3543 |
3544 // If viewport tag is enabled, then the WebKit side will take care | 3544 // If viewport tag is enabled, then the WebKit side will take care |
3545 // of setting the fixed layout size and page scale limits. | 3545 // of setting the fixed layout size and page scale limits. |
3546 if (enable_viewport) | 3546 if (enable_viewport) |
3547 return; | 3547 return; |
3548 | 3548 |
| 3549 // When navigating to a new page, reset the page scale factor to be 1.0. |
| 3550 webview()->setInitialPageScaleOverride(1.f); |
| 3551 |
3549 if (enable_fixed_layout) { | 3552 if (enable_fixed_layout) { |
3550 std::string str = | 3553 std::string str = |
3551 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); | 3554 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); |
3552 std::vector<std::string> tokens; | 3555 std::vector<std::string> tokens; |
3553 base::SplitString(str, ',', &tokens); | 3556 base::SplitString(str, ',', &tokens); |
3554 if (tokens.size() == 2) { | 3557 if (tokens.size() == 2) { |
3555 int width, height; | 3558 int width, height; |
3556 if (base::StringToInt(tokens[0], &width) && | 3559 if (base::StringToInt(tokens[0], &width) && |
3557 base::StringToInt(tokens[1], &height)) | 3560 base::StringToInt(tokens[1], &height)) |
3558 webview()->setFixedLayoutSize(WebSize(width, height)); | 3561 webview()->setFixedLayoutSize(WebSize(width, height)); |
(...skipping 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6548 WebURL url = icon_urls[i].iconURL(); | 6551 WebURL url = icon_urls[i].iconURL(); |
6549 if (!url.isEmpty()) | 6552 if (!url.isEmpty()) |
6550 urls.push_back(FaviconURL(url, | 6553 urls.push_back(FaviconURL(url, |
6551 ToFaviconType(icon_urls[i].iconType()))); | 6554 ToFaviconType(icon_urls[i].iconType()))); |
6552 } | 6555 } |
6553 SendUpdateFaviconURL(urls); | 6556 SendUpdateFaviconURL(urls); |
6554 } | 6557 } |
6555 | 6558 |
6556 | 6559 |
6557 } // namespace content | 6560 } // namespace content |
OLD | NEW |