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

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

Issue 11759023: [Android WebView] Implement WebSettings.{get|set}UseWideViewport (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix tests that were expecting UseWideViewPort=true Created 7 years, 11 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 | « content/public/common/common_param_traits_macros.h ('k') | webkit/glue/webpreferences.h » ('j') | 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/bind.h" 10 #include "base/bind.h"
(...skipping 3258 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 3269
3270 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { 3270 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) {
3271 bool enable_viewport = 3271 bool enable_viewport =
3272 command_line.HasSwitch(switches::kEnableViewport); 3272 command_line.HasSwitch(switches::kEnableViewport);
3273 bool enable_fixed_layout = 3273 bool enable_fixed_layout =
3274 command_line.HasSwitch(switches::kEnableFixedLayout); 3274 command_line.HasSwitch(switches::kEnableFixedLayout);
3275 3275
3276 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); 3276 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport);
3277 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); 3277 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true);
3278 3278
3279 if (enable_viewport) { 3279 if (!enable_viewport && enable_fixed_layout) {
3280 webview()->settings()->setViewportEnabled(true);
3281 } else if (enable_fixed_layout) {
3282 std::string str = 3280 std::string str =
3283 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); 3281 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout);
3284 std::vector<std::string> tokens; 3282 std::vector<std::string> tokens;
3285 base::SplitString(str, ',', &tokens); 3283 base::SplitString(str, ',', &tokens);
3286 if (tokens.size() == 2) { 3284 if (tokens.size() == 2) {
3287 int width, height; 3285 int width, height;
3288 if (base::StringToInt(tokens[0], &width) && 3286 if (base::StringToInt(tokens[0], &width) &&
3289 base::StringToInt(tokens[1], &height)) 3287 base::StringToInt(tokens[1], &height))
3290 webview()->setFixedLayoutSize(WebSize(width, height)); 3288 webview()->setFixedLayoutSize(WebSize(width, height));
3291 } 3289 }
(...skipping 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after
6573 } 6571 }
6574 #endif 6572 #endif
6575 6573
6576 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6574 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6577 TransportDIB::Handle dib_handle) { 6575 TransportDIB::Handle dib_handle) {
6578 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6576 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6579 RenderProcess::current()->ReleaseTransportDIB(dib); 6577 RenderProcess::current()->ReleaseTransportDIB(dib);
6580 } 6578 }
6581 6579
6582 } // namespace content 6580 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/common_param_traits_macros.h ('k') | webkit/glue/webpreferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698