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

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 #20 comments. 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 public: 117 public:
118 static MediaControlPlayButtonElement* create(MediaControls&); 118 static MediaControlPlayButtonElement* create(MediaControls&);
119 119
120 bool willRespondToMouseClickEvents() override { return true; } 120 bool willRespondToMouseClickEvents() override { return true; }
121 void updateDisplayType() override; 121 void updateDisplayType() override;
122 122
123 WebLocalizedString::Name getOverflowStringName() override; 123 WebLocalizedString::Name getOverflowStringName() override;
124 124
125 bool hasOverflowButton() override { return true; } 125 bool hasOverflowButton() override { return true; }
126 126
127 void onMediaKeyboardEvent(Event* event) { defaultEventHandler(event); }
128
127 private: 129 private:
128 explicit MediaControlPlayButtonElement(MediaControls&); 130 explicit MediaControlPlayButtonElement(MediaControls&);
129 131
130 void defaultEventHandler(Event*) override; 132 void defaultEventHandler(Event*) override;
131 }; 133 };
132 134
133 // ---------------------------- 135 // ----------------------------
134 136
135 class CORE_EXPORT MediaControlOverlayPlayButtonElement final 137 class CORE_EXPORT MediaControlOverlayPlayButtonElement final
136 : public MediaControlInputElement { 138 : public MediaControlInputElement {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 public: 274 public:
273 static MediaControlTimelineElement* create(MediaControls&); 275 static MediaControlTimelineElement* create(MediaControls&);
274 276
275 bool willRespondToMouseClickEvents() override; 277 bool willRespondToMouseClickEvents() override;
276 278
277 // FIXME: An "earliest possible position" will be needed once that concept 279 // FIXME: An "earliest possible position" will be needed once that concept
278 // is supported by HTMLMediaElement, see https://crbug.com/137275 280 // is supported by HTMLMediaElement, see https://crbug.com/137275
279 void setPosition(double); 281 void setPosition(double);
280 void setDuration(double); 282 void setDuration(double);
281 283
284 void onMediaKeyboardEvent(Event* event) { defaultEventHandler(event); }
285
282 private: 286 private:
283 explicit MediaControlTimelineElement(MediaControls&); 287 explicit MediaControlTimelineElement(MediaControls&);
284 288
285 void defaultEventHandler(Event*) override; 289 void defaultEventHandler(Event*) override;
286 bool keepEventInNode(Event*) override; 290 bool keepEventInNode(Event*) override;
287 }; 291 };
288 292
289 // ---------------------------- 293 // ----------------------------
290 294
291 class CORE_EXPORT MediaControlFullscreenButtonElement final 295 class CORE_EXPORT MediaControlFullscreenButtonElement final
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 359
356 class CORE_EXPORT MediaControlVolumeSliderElement final 360 class CORE_EXPORT MediaControlVolumeSliderElement final
357 : public MediaControlInputElement { 361 : public MediaControlInputElement {
358 public: 362 public:
359 static MediaControlVolumeSliderElement* create(MediaControls&); 363 static MediaControlVolumeSliderElement* create(MediaControls&);
360 364
361 bool willRespondToMouseMoveEvents() override; 365 bool willRespondToMouseMoveEvents() override;
362 bool willRespondToMouseClickEvents() override; 366 bool willRespondToMouseClickEvents() override;
363 void setVolume(double); 367 void setVolume(double);
364 368
369 void onMediaKeyboardEvent(Event* event) { defaultEventHandler(event); }
370
365 private: 371 private:
366 explicit MediaControlVolumeSliderElement(MediaControls&); 372 explicit MediaControlVolumeSliderElement(MediaControls&);
367 373
368 void defaultEventHandler(Event*) override; 374 void defaultEventHandler(Event*) override;
369 bool keepEventInNode(Event*) override; 375 bool keepEventInNode(Event*) override;
370 }; 376 };
371 377
372 // ---------------------------- 378 // ----------------------------
373 379
374 class CORE_EXPORT MediaControlTimeRemainingDisplayElement final 380 class CORE_EXPORT MediaControlTimeRemainingDisplayElement final
(...skipping 12 matching lines...) Expand all
387 public: 393 public:
388 static MediaControlCurrentTimeDisplayElement* create(MediaControls&); 394 static MediaControlCurrentTimeDisplayElement* create(MediaControls&);
389 395
390 private: 396 private:
391 explicit MediaControlCurrentTimeDisplayElement(MediaControls&); 397 explicit MediaControlCurrentTimeDisplayElement(MediaControls&);
392 }; 398 };
393 399
394 } // namespace blink 400 } // namespace blink
395 401
396 #endif // MediaControlElements_h 402 #endif // MediaControlElements_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698