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/bind.h" | 10 #include "base/bind.h" |
(...skipping 3199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3210 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { | 3210 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { |
3211 bool enable_viewport = | 3211 bool enable_viewport = |
3212 command_line.HasSwitch(switches::kEnableViewport); | 3212 command_line.HasSwitch(switches::kEnableViewport); |
3213 bool enable_fixed_layout = | 3213 bool enable_fixed_layout = |
3214 command_line.HasSwitch(switches::kEnableFixedLayout); | 3214 command_line.HasSwitch(switches::kEnableFixedLayout); |
3215 | 3215 |
3216 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); | 3216 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); |
3217 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); | 3217 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); |
3218 | 3218 |
3219 if (enable_viewport) { | 3219 if (enable_viewport) { |
3220 webkit_preferences_.viewport_enabled = true; | |
darin (slow to review)
2013/01/08 17:10:42
It seems a little odd to be setting a WebPreferenc
mnaganov (inactive)
2013/01/08 18:14:44
Yes, it does look odd to me as well. But as you ca
| |
3220 webview()->settings()->setViewportEnabled(true); | 3221 webview()->settings()->setViewportEnabled(true); |
3221 } else if (enable_fixed_layout) { | 3222 } else if (enable_fixed_layout) { |
3222 std::string str = | 3223 std::string str = |
3223 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); | 3224 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); |
3224 std::vector<std::string> tokens; | 3225 std::vector<std::string> tokens; |
3225 base::SplitString(str, ',', &tokens); | 3226 base::SplitString(str, ',', &tokens); |
3226 if (tokens.size() == 2) { | 3227 if (tokens.size() == 2) { |
3227 int width, height; | 3228 int width, height; |
3228 if (base::StringToInt(tokens[0], &width) && | 3229 if (base::StringToInt(tokens[0], &width) && |
3229 base::StringToInt(tokens[1], &height)) | 3230 base::StringToInt(tokens[1], &height)) |
(...skipping 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6506 } | 6507 } |
6507 #endif | 6508 #endif |
6508 | 6509 |
6509 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6510 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6510 TransportDIB::Handle dib_handle) { | 6511 TransportDIB::Handle dib_handle) { |
6511 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6512 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6512 RenderProcess::current()->ReleaseTransportDIB(dib); | 6513 RenderProcess::current()->ReleaseTransportDIB(dib); |
6513 } | 6514 } |
6514 | 6515 |
6515 } // namespace content | 6516 } // namespace content |
OLD | NEW |