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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.h

Issue 2700663002: Adds keyboard functionality for videos. (Closed)
Patch Set: Addresses mlamouri's #22, adds tests. Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 public: 75 public:
76 static MediaControlPlayButtonElement* Create(MediaControls&); 76 static MediaControlPlayButtonElement* Create(MediaControls&);
77 77
78 bool WillRespondToMouseClickEvents() override { return true; } 78 bool WillRespondToMouseClickEvents() override { return true; }
79 void UpdateDisplayType() override; 79 void UpdateDisplayType() override;
80 80
81 WebLocalizedString::Name GetOverflowStringName() override; 81 WebLocalizedString::Name GetOverflowStringName() override;
82 82
83 bool HasOverflowButton() override { return true; } 83 bool HasOverflowButton() override { return true; }
84 84
85 void OnMediaKeyboardEvent(Event* event) { DefaultEventHandler(event); }
86
85 private: 87 private:
86 explicit MediaControlPlayButtonElement(MediaControls&); 88 explicit MediaControlPlayButtonElement(MediaControls&);
87 89
88 void DefaultEventHandler(Event*) override; 90 void DefaultEventHandler(Event*) override;
89 }; 91 };
90 92
91 // ---------------------------- 93 // ----------------------------
92 94
93 class CORE_EXPORT MediaControlOverlayPlayButtonElement final 95 class CORE_EXPORT MediaControlOverlayPlayButtonElement final
94 : public MediaControlInputElement { 96 : public MediaControlInputElement {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 234
233 bool WillRespondToMouseClickEvents() override; 235 bool WillRespondToMouseClickEvents() override;
234 236
235 // FIXME: An "earliest possible position" will be needed once that concept 237 // FIXME: An "earliest possible position" will be needed once that concept
236 // is supported by HTMLMediaElement, see https://crbug.com/137275 238 // is supported by HTMLMediaElement, see https://crbug.com/137275
237 void SetPosition(double); 239 void SetPosition(double);
238 void SetDuration(double); 240 void SetDuration(double);
239 241
240 void OnPlaying(); 242 void OnPlaying();
241 243
244 void onMediaKeyboardEvent(Event* event) { DefaultEventHandler(event); }
245
242 private: 246 private:
243 explicit MediaControlTimelineElement(MediaControls&); 247 explicit MediaControlTimelineElement(MediaControls&);
244 248
245 void DefaultEventHandler(Event*) override; 249 void DefaultEventHandler(Event*) override;
246 bool KeepEventInNode(Event*) override; 250 bool KeepEventInNode(Event*) override;
247 251
248 // Width in CSS pixels * pageZoomFactor (ignores CSS transforms for 252 // Width in CSS pixels * pageZoomFactor (ignores CSS transforms for
249 // simplicity; deliberately ignores pinch zoom's pageScaleFactor). 253 // simplicity; deliberately ignores pinch zoom's pageScaleFactor).
250 int TimelineWidth(); 254 int TimelineWidth();
251 255
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 326
323 class CORE_EXPORT MediaControlVolumeSliderElement final 327 class CORE_EXPORT MediaControlVolumeSliderElement final
324 : public MediaControlInputElement { 328 : public MediaControlInputElement {
325 public: 329 public:
326 static MediaControlVolumeSliderElement* Create(MediaControls&); 330 static MediaControlVolumeSliderElement* Create(MediaControls&);
327 331
328 bool WillRespondToMouseMoveEvents() override; 332 bool WillRespondToMouseMoveEvents() override;
329 bool WillRespondToMouseClickEvents() override; 333 bool WillRespondToMouseClickEvents() override;
330 void SetVolume(double); 334 void SetVolume(double);
331 335
336 void onMediaKeyboardEvent(Event* event) { DefaultEventHandler(event); }
337
332 private: 338 private:
333 explicit MediaControlVolumeSliderElement(MediaControls&); 339 explicit MediaControlVolumeSliderElement(MediaControls&);
334 340
335 void DefaultEventHandler(Event*) override; 341 void DefaultEventHandler(Event*) override;
336 bool KeepEventInNode(Event*) override; 342 bool KeepEventInNode(Event*) override;
337 }; 343 };
338 344
339 } // namespace blink 345 } // namespace blink
340 346
341 #endif // MediaControlElements_h 347 #endif // MediaControlElements_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698