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/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 GpuProcessHost::gpu_enabled() && | 434 GpuProcessHost::gpu_enabled() && |
435 !command_line.HasSwitch(switches::kDisableAccelerated2dCanvas); | 435 !command_line.HasSwitch(switches::kDisableAccelerated2dCanvas); |
436 prefs.antialiased_2d_canvas_disabled = | 436 prefs.antialiased_2d_canvas_disabled = |
437 command_line.HasSwitch(switches::kDisable2dCanvasAntialiasing); | 437 command_line.HasSwitch(switches::kDisable2dCanvasAntialiasing); |
438 prefs.antialiased_clips_2d_canvas_enabled = | 438 prefs.antialiased_clips_2d_canvas_enabled = |
439 command_line.HasSwitch(switches::kEnable2dCanvasClipAntialiasing); | 439 command_line.HasSwitch(switches::kEnable2dCanvasClipAntialiasing); |
440 prefs.accelerated_2d_canvas_msaa_sample_count = | 440 prefs.accelerated_2d_canvas_msaa_sample_count = |
441 atoi(command_line.GetSwitchValueASCII( | 441 atoi(command_line.GetSwitchValueASCII( |
442 switches::kAcceleratedCanvas2dMSAASampleCount).c_str()); | 442 switches::kAcceleratedCanvas2dMSAASampleCount).c_str()); |
443 | 443 |
| 444 prefs.inert_visual_viewport = |
| 445 command_line.HasSwitch(switches::kInertVisualViewport); |
| 446 |
444 prefs.pinch_overlay_scrollbar_thickness = 10; | 447 prefs.pinch_overlay_scrollbar_thickness = 10; |
445 prefs.use_solid_color_scrollbars = ui::IsOverlayScrollbarEnabled(); | 448 prefs.use_solid_color_scrollbars = ui::IsOverlayScrollbarEnabled(); |
446 | 449 |
447 #if defined(OS_ANDROID) | 450 #if defined(OS_ANDROID) |
448 // On Android, user gestures are normally required, unless that requirement | 451 // On Android, user gestures are normally required, unless that requirement |
449 // is disabled with a command-line switch or the equivalent field trial is | 452 // is disabled with a command-line switch or the equivalent field trial is |
450 // is set to "Enabled". | 453 // is set to "Enabled". |
451 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( | 454 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( |
452 "MediaElementAutoplay"); | 455 "MediaElementAutoplay"); |
453 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( | 456 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 | 1373 |
1371 gfx::Point RenderViewHostImpl::ConvertDIPToViewport(const gfx::Point& point) { | 1374 gfx::Point RenderViewHostImpl::ConvertDIPToViewport(const gfx::Point& point) { |
1372 // The point in guest view is already converted. | 1375 // The point in guest view is already converted. |
1373 if (!render_widget_host_->scale_input_to_viewport()) | 1376 if (!render_widget_host_->scale_input_to_viewport()) |
1374 return point; | 1377 return point; |
1375 float scale = GetWidget()->GetView()->current_device_scale_factor(); | 1378 float scale = GetWidget()->GetView()->current_device_scale_factor(); |
1376 return gfx::Point(point.x() * scale, point.y() * scale); | 1379 return gfx::Point(point.x() * scale, point.y() * scale); |
1377 } | 1380 } |
1378 | 1381 |
1379 } // namespace content | 1382 } // namespace content |
OLD | NEW |