OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 19 matching lines...) Expand all Loading... | |
30 #include "core/dom/ClientRect.h" | 30 #include "core/dom/ClientRect.h" |
31 #include "core/dom/Fullscreen.h" | 31 #include "core/dom/Fullscreen.h" |
32 #include "core/dom/MutationCallback.h" | 32 #include "core/dom/MutationCallback.h" |
33 #include "core/dom/MutationObserver.h" | 33 #include "core/dom/MutationObserver.h" |
34 #include "core/dom/MutationObserverInit.h" | 34 #include "core/dom/MutationObserverInit.h" |
35 #include "core/dom/MutationRecord.h" | 35 #include "core/dom/MutationRecord.h" |
36 #include "core/dom/ResizeObserver.h" | 36 #include "core/dom/ResizeObserver.h" |
37 #include "core/dom/ResizeObserverCallback.h" | 37 #include "core/dom/ResizeObserverCallback.h" |
38 #include "core/dom/ResizeObserverEntry.h" | 38 #include "core/dom/ResizeObserverEntry.h" |
39 #include "core/dom/TaskRunnerHelper.h" | 39 #include "core/dom/TaskRunnerHelper.h" |
40 #include "core/events/KeyboardEvent.h" | |
40 #include "core/events/MouseEvent.h" | 41 #include "core/events/MouseEvent.h" |
41 #include "core/frame/Settings.h" | 42 #include "core/frame/Settings.h" |
42 #include "core/frame/UseCounter.h" | 43 #include "core/frame/UseCounter.h" |
43 #include "core/html/HTMLMediaElement.h" | 44 #include "core/html/HTMLMediaElement.h" |
44 #include "core/html/HTMLVideoElement.h" | 45 #include "core/html/HTMLVideoElement.h" |
45 #include "core/html/media/HTMLMediaElementControlsList.h" | 46 #include "core/html/media/HTMLMediaElementControlsList.h" |
46 #include "core/html/track/TextTrackContainer.h" | 47 #include "core/html/track/TextTrackContainer.h" |
47 #include "core/html/track/TextTrackList.h" | 48 #include "core/html/track/TextTrackList.h" |
48 #include "core/layout/LayoutObject.h" | 49 #include "core/layout/LayoutObject.h" |
49 #include "core/layout/LayoutTheme.h" | 50 #include "core/layout/LayoutTheme.h" |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
845 StartHideMediaControlsTimer(); | 846 StartHideMediaControlsTimer(); |
846 return; | 847 return; |
847 } | 848 } |
848 | 849 |
849 // If the user is interacting with the controls via the keyboard, don't hide | 850 // If the user is interacting with the controls via the keyboard, don't hide |
850 // the controls. This will fire when the user tabs between controls (focusin) | 851 // the controls. This will fire when the user tabs between controls (focusin) |
851 // or when they seek either the timeline or volume sliders (input). | 852 // or when they seek either the timeline or volume sliders (input). |
852 if (event->type() == EventTypeNames::focusin || | 853 if (event->type() == EventTypeNames::focusin || |
853 event->type() == EventTypeNames::input) | 854 event->type() == EventTypeNames::input) |
854 ResetHideMediaControlsTimer(); | 855 ResetHideMediaControlsTimer(); |
856 | |
857 if (event->IsKeyboardEvent() && !IsSpatialNavigationActive()) { | |
mlamouri (slow - plz ping)
2017/05/24 08:49:15
Would it make sense to allow "enter" and "space" t
lethalantidote
2017/05/24 18:46:08
Maybe, but wouldn't that cause inconsistency? It's
mlamouri (slow - plz ping)
2017/05/30 10:22:41
I have no strong opinion on this. Whatever sounds
| |
858 const String& key = ToKeyboardEvent(event)->key(); | |
859 if (key == "Enter" || ToKeyboardEvent(event)->keyCode() == ' ') { | |
860 play_button_->OnMediaKeyboardEvent(event); | |
861 return; | |
862 } | |
863 if (key == "ArrowLeft" || key == "ArrowRight" || key == "Home" || | |
864 key == "End") { | |
865 timeline_->OnMediaKeyboardEvent(event); | |
866 return; | |
867 } | |
868 if (key == "ArrowDown" || key == "ArrowUp") { | |
869 volume_slider_->OnMediaKeyboardEvent(event); | |
870 return; | |
871 } | |
872 } | |
855 } | 873 } |
856 | 874 |
857 void MediaControlsImpl::HideMediaControlsTimerFired(TimerBase*) { | 875 void MediaControlsImpl::HideMediaControlsTimerFired(TimerBase*) { |
858 unsigned behavior_flags = | 876 unsigned behavior_flags = |
859 hide_timer_behavior_flags_ | kIgnoreFocus | kIgnoreVideoHover; | 877 hide_timer_behavior_flags_ | kIgnoreFocus | kIgnoreVideoHover; |
860 hide_timer_behavior_flags_ = kIgnoreNone; | 878 hide_timer_behavior_flags_ = kIgnoreNone; |
861 keep_showing_until_timer_fires_ = false; | 879 keep_showing_until_timer_fires_ = false; |
862 | 880 |
863 if (MediaElement().paused()) | 881 if (MediaElement().paused()) |
864 return; | 882 return; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1217 visitor->Trace(overlay_cast_button_); | 1235 visitor->Trace(overlay_cast_button_); |
1218 visitor->Trace(media_event_listener_); | 1236 visitor->Trace(media_event_listener_); |
1219 visitor->Trace(window_event_listener_); | 1237 visitor->Trace(window_event_listener_); |
1220 visitor->Trace(orientation_lock_delegate_); | 1238 visitor->Trace(orientation_lock_delegate_); |
1221 visitor->Trace(rotate_to_fullscreen_delegate_); | 1239 visitor->Trace(rotate_to_fullscreen_delegate_); |
1222 MediaControls::Trace(visitor); | 1240 MediaControls::Trace(visitor); |
1223 HTMLDivElement::Trace(visitor); | 1241 HTMLDivElement::Trace(visitor); |
1224 } | 1242 } |
1225 | 1243 |
1226 } // namespace blink | 1244 } // namespace blink |
OLD | NEW |