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

Side by Side Diff: Source/core/layout/LayoutMediaControls.cpp

Issue 1082533002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 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) 2009 Apple Inc. 2 * Copyright (C) 2009 Apple Inc.
3 * Copyright (C) 2009 Google Inc. 3 * Copyright (C) 2009 Google Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 case MediaCastOffButton: 368 case MediaCastOffButton:
369 return paintMediaButton(paintInfo.context, rect, mediaCastOff); 369 return paintMediaButton(paintInfo.context, rect, mediaCastOff);
370 case MediaOverlayCastOffButton: 370 case MediaOverlayCastOffButton:
371 return paintMediaButton(paintInfo.context, rect, mediaOverlayCastOff); 371 return paintMediaButton(paintInfo.context, rect, mediaOverlayCastOff);
372 default: 372 default:
373 ASSERT_NOT_REACHED(); 373 ASSERT_NOT_REACHED();
374 return false; 374 return false;
375 } 375 }
376 } 376 }
377 377
378 static bool paintMediaTrackSelectionCheckmark(LayoutObject* object, const PaintI nfo& paintInfo, const IntRect& rect)
379 {
380 HTMLMediaElement* mediaElement = toParentMediaElement(object);
381 if (!mediaElement)
382 return false;
383
384 static Image* mediaTrackSelectionCheckmark = platformResource("mediaplayerTr ackSelectionCheckmark");
385 return paintMediaButton(paintInfo.context, rect, mediaTrackSelectionCheckmar k);
386 }
387
378 bool LayoutMediaControls::paintMediaControlsPart(MediaControlElementType part, L ayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect) 388 bool LayoutMediaControls::paintMediaControlsPart(MediaControlElementType part, L ayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
379 { 389 {
380 switch (part) { 390 switch (part) {
381 case MediaMuteButton: 391 case MediaMuteButton:
382 case MediaUnMuteButton: 392 case MediaUnMuteButton:
383 return paintMediaMuteButton(object, paintInfo, rect); 393 return paintMediaMuteButton(object, paintInfo, rect);
384 case MediaPauseButton: 394 case MediaPauseButton:
385 case MediaPlayButton: 395 case MediaPlayButton:
386 return paintMediaPlayButton(object, paintInfo, rect); 396 return paintMediaPlayButton(object, paintInfo, rect);
387 case MediaShowClosedCaptionsButton: 397 case MediaShowClosedCaptionsButton:
388 return paintMediaToggleClosedCaptionsButton(object, paintInfo, rect); 398 return paintMediaToggleClosedCaptionsButton(object, paintInfo, rect);
389 case MediaSlider: 399 case MediaSlider:
390 return paintMediaSlider(object, paintInfo, rect); 400 return paintMediaSlider(object, paintInfo, rect);
391 case MediaSliderThumb: 401 case MediaSliderThumb:
392 return paintMediaSliderThumb(object, paintInfo, rect); 402 return paintMediaSliderThumb(object, paintInfo, rect);
393 case MediaVolumeSlider: 403 case MediaVolumeSlider:
394 return paintMediaVolumeSlider(object, paintInfo, rect); 404 return paintMediaVolumeSlider(object, paintInfo, rect);
395 case MediaVolumeSliderThumb: 405 case MediaVolumeSliderThumb:
396 return paintMediaVolumeSliderThumb(object, paintInfo, rect); 406 return paintMediaVolumeSliderThumb(object, paintInfo, rect);
397 case MediaEnterFullscreenButton: 407 case MediaEnterFullscreenButton:
398 case MediaExitFullscreenButton: 408 case MediaExitFullscreenButton:
399 return paintMediaFullscreenButton(object, paintInfo, rect); 409 return paintMediaFullscreenButton(object, paintInfo, rect);
400 case MediaOverlayPlayButton: 410 case MediaOverlayPlayButton:
401 return paintMediaOverlayPlayButton(object, paintInfo, rect); 411 return paintMediaOverlayPlayButton(object, paintInfo, rect);
402 case MediaCastOffButton: 412 case MediaCastOffButton:
403 case MediaCastOnButton: 413 case MediaCastOnButton:
404 case MediaOverlayCastOffButton: 414 case MediaOverlayCastOffButton:
405 case MediaOverlayCastOnButton: 415 case MediaOverlayCastOnButton:
406 return paintMediaCastButton(object, paintInfo, rect); 416 return paintMediaCastButton(object, paintInfo, rect);
417 case MediaTrackSelectionCheckmark:
418 return paintMediaTrackSelectionCheckmark(object, paintInfo, rect);
407 case MediaVolumeSliderContainer: 419 case MediaVolumeSliderContainer:
408 case MediaTimelineContainer: 420 case MediaTimelineContainer:
409 case MediaCurrentTimeDisplay: 421 case MediaCurrentTimeDisplay:
410 case MediaTimeRemainingDisplay: 422 case MediaTimeRemainingDisplay:
411 case MediaControlsPanel: 423 case MediaControlsPanel:
412 case MediaHideClosedCaptionsButton: 424 case MediaHideClosedCaptionsButton:
425 case MediaTextTrackList:
413 case MediaFullScreenVolumeSlider: 426 case MediaFullScreenVolumeSlider:
414 case MediaFullScreenVolumeSliderThumb: 427 case MediaFullScreenVolumeSliderThumb:
415 ASSERT_NOT_REACHED(); 428 ASSERT_NOT_REACHED();
416 break; 429 break;
417 } 430 }
418 return false; 431 return false;
419 } 432 }
420 433
421 const int mediaSliderThumbHeight = 24; 434 const int mediaSliderThumbHeight = 24;
422 const int mediaVolumeSliderThumbHeight = 24; 435 const int mediaVolumeSliderThumbHeight = 24;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 { 487 {
475 return formatChromiumMediaControlsTime(time, time); 488 return formatChromiumMediaControlsTime(time, time);
476 } 489 }
477 490
478 String LayoutMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration) 491 String LayoutMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration)
479 { 492 {
480 return formatChromiumMediaControlsTime(currentTime, duration); 493 return formatChromiumMediaControlsTime(currentTime, duration);
481 } 494 }
482 495
483 } // namespace blink 496 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698