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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 #if defined(OS_ANDROID) | 439 #if defined(OS_ANDROID) |
440 // On Android, user gestures are normally required, unless that requirement | 440 // On Android, user gestures are normally required, unless that requirement |
441 // is disabled with a command-line switch or the equivalent field trial is | 441 // is disabled with a command-line switch or the equivalent field trial is |
442 // is set to "Enabled". | 442 // is set to "Enabled". |
443 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( | 443 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( |
444 "MediaElementAutoplay"); | 444 "MediaElementAutoplay"); |
445 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( | 445 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( |
446 switches::kDisableGestureRequirementForMediaPlayback) && | 446 switches::kDisableGestureRequirementForMediaPlayback) && |
447 (autoplay_group_name.empty() || autoplay_group_name != "Enabled"); | 447 (autoplay_group_name.empty() || autoplay_group_name != "Enabled"); |
| 448 |
| 449 // Handle autoplay gesture override experiment. |
| 450 // Note that anything but a well-formed string turns the experiment off. |
| 451 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName( |
| 452 "MediaElementGestureOverrideExperiment"); |
448 #endif | 453 #endif |
449 | 454 |
450 prefs.touch_enabled = ui::AreTouchEventsEnabled(); | 455 prefs.touch_enabled = ui::AreTouchEventsEnabled(); |
451 prefs.device_supports_touch = prefs.touch_enabled && | 456 prefs.device_supports_touch = prefs.touch_enabled && |
452 ui::IsTouchDevicePresent(); | 457 ui::IsTouchDevicePresent(); |
453 prefs.available_pointer_types = ui::GetAvailablePointerTypes(); | 458 prefs.available_pointer_types = ui::GetAvailablePointerTypes(); |
454 prefs.primary_pointer_type = ui::GetPrimaryPointerType(); | 459 prefs.primary_pointer_type = ui::GetPrimaryPointerType(); |
455 prefs.available_hover_types = ui::GetAvailableHoverTypes(); | 460 prefs.available_hover_types = ui::GetAvailableHoverTypes(); |
456 prefs.primary_hover_type = ui::GetPrimaryHoverType(); | 461 prefs.primary_hover_type = ui::GetPrimaryHoverType(); |
457 | 462 |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1435 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
1431 policy->GrantReadFile(GetProcess()->GetID(), file); | 1436 policy->GrantReadFile(GetProcess()->GetID(), file); |
1432 } | 1437 } |
1433 } | 1438 } |
1434 | 1439 |
1435 void RenderViewHostImpl::SelectWordAroundCaret() { | 1440 void RenderViewHostImpl::SelectWordAroundCaret() { |
1436 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1441 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1437 } | 1442 } |
1438 | 1443 |
1439 } // namespace content | 1444 } // namespace content |
OLD | NEW |