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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp

Issue 2814703002: Media Controls: move time display elements to media_controls module. (Closed)
Patch Set: review 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) 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 28 matching lines...) Expand all
39 #include "core/html/HTMLMediaElement.h" 39 #include "core/html/HTMLMediaElement.h"
40 #include "core/html/HTMLVideoElement.h" 40 #include "core/html/HTMLVideoElement.h"
41 #include "core/html/media/HTMLMediaElementControlsList.h" 41 #include "core/html/media/HTMLMediaElementControlsList.h"
42 #include "core/html/track/TextTrackContainer.h" 42 #include "core/html/track/TextTrackContainer.h"
43 #include "core/html/track/TextTrackList.h" 43 #include "core/html/track/TextTrackList.h"
44 #include "core/layout/LayoutObject.h" 44 #include "core/layout/LayoutObject.h"
45 #include "core/layout/LayoutTheme.h" 45 #include "core/layout/LayoutTheme.h"
46 #include "modules/media_controls/MediaControlsMediaEventListener.h" 46 #include "modules/media_controls/MediaControlsMediaEventListener.h"
47 #include "modules/media_controls/MediaControlsOrientationLockDelegate.h" 47 #include "modules/media_controls/MediaControlsOrientationLockDelegate.h"
48 #include "modules/media_controls/MediaControlsWindowEventListener.h" 48 #include "modules/media_controls/MediaControlsWindowEventListener.h"
49 #include "modules/media_controls/elements/MediaControlCurrentTimeDisplayElement. h"
49 #include "modules/media_controls/elements/MediaControlMuteButtonElement.h" 50 #include "modules/media_controls/elements/MediaControlMuteButtonElement.h"
50 #include "modules/media_controls/elements/MediaControlOverlayEnclosureElement.h" 51 #include "modules/media_controls/elements/MediaControlOverlayEnclosureElement.h"
51 #include "modules/media_controls/elements/MediaControlPanelEnclosureElement.h" 52 #include "modules/media_controls/elements/MediaControlPanelEnclosureElement.h"
53 #include "modules/media_controls/elements/MediaControlRemainingTimeDisplayElemen t.h"
52 #include "platform/EventDispatchForbiddenScope.h" 54 #include "platform/EventDispatchForbiddenScope.h"
53 55
54 namespace blink { 56 namespace blink {
55 57
56 namespace { 58 namespace {
57 59
58 // TODO(steimel): should have better solution than hard-coding pixel values. 60 // TODO(steimel): should have better solution than hard-coding pixel values.
59 // Defined in core/css/mediaControls.css, core/css/mediaControlsAndroid.css, 61 // Defined in core/css/mediaControls.css, core/css/mediaControlsAndroid.css,
60 // and core/paint/MediaControlsPainter.cpp. 62 // and core/paint/MediaControlsPainter.cpp.
61 constexpr int kOverlayPlayButtonWidth = 48; 63 constexpr int kOverlayPlayButtonWidth = 48;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // | \-MediaControlCastButtonElement 264 // | \-MediaControlCastButtonElement
263 // | (-internal-media-controls-overlay-cast-button) 265 // | (-internal-media-controls-overlay-cast-button)
264 // \-MediaControlPanelEnclosureElement 266 // \-MediaControlPanelEnclosureElement
265 // | (-webkit-media-controls-enclosure) 267 // | (-webkit-media-controls-enclosure)
266 // \-MediaControlPanelElement 268 // \-MediaControlPanelElement
267 // | (-webkit-media-controls-panel) 269 // | (-webkit-media-controls-panel)
268 // +-MediaControlPlayButtonElement 270 // +-MediaControlPlayButtonElement
269 // | (-webkit-media-controls-play-button) 271 // | (-webkit-media-controls-play-button)
270 // +-MediaControlCurrentTimeDisplayElement 272 // +-MediaControlCurrentTimeDisplayElement
271 // | (-webkit-media-controls-current-time-display) 273 // | (-webkit-media-controls-current-time-display)
272 // +-MediaControlTimeRemainingDisplayElement 274 // +-MediaControlRemainingTimeDisplayElement
273 // | (-webkit-media-controls-time-remaining-display) 275 // | (-webkit-media-controls-time-remaining-display)
274 // +-MediaControlTimelineElement 276 // +-MediaControlTimelineElement
275 // | (-webkit-media-controls-timeline) 277 // | (-webkit-media-controls-timeline)
276 // +-MediaControlMuteButtonElement 278 // +-MediaControlMuteButtonElement
277 // | (-webkit-media-controls-mute-button) 279 // | (-webkit-media-controls-mute-button)
278 // +-MediaControlVolumeSliderElement 280 // +-MediaControlVolumeSliderElement
279 // | (-webkit-media-controls-volume-slider) 281 // | (-webkit-media-controls-volume-slider)
280 // +-MediaControlFullscreenButtonElement 282 // +-MediaControlFullscreenButtonElement
281 // | (-webkit-media-controls-fullscreen-button) 283 // | (-webkit-media-controls-fullscreen-button)
282 // +-MediaControlDownloadButtonElement 284 // +-MediaControlDownloadButtonElement
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 // controls correctly. 319 // controls correctly.
318 enclosure_ = new MediaControlPanelEnclosureElement(*this); 320 enclosure_ = new MediaControlPanelEnclosureElement(*this);
319 321
320 MediaControlPanelElement* panel = MediaControlPanelElement::Create(*this); 322 MediaControlPanelElement* panel = MediaControlPanelElement::Create(*this);
321 323
322 MediaControlPlayButtonElement* play_button = 324 MediaControlPlayButtonElement* play_button =
323 MediaControlPlayButtonElement::Create(*this); 325 MediaControlPlayButtonElement::Create(*this);
324 play_button_ = play_button; 326 play_button_ = play_button;
325 panel->AppendChild(play_button); 327 panel->AppendChild(play_button);
326 328
327 MediaControlCurrentTimeDisplayElement* current_time_display = 329 current_time_display_ = new MediaControlCurrentTimeDisplayElement(*this);
328 MediaControlCurrentTimeDisplayElement::Create(*this);
329 current_time_display_ = current_time_display;
330 current_time_display_->SetIsWanted(true); 330 current_time_display_->SetIsWanted(true);
331 panel->AppendChild(current_time_display); 331 panel->AppendChild(current_time_display_);
332 332
333 MediaControlTimeRemainingDisplayElement* duration_display = 333 duration_display_ = new MediaControlRemainingTimeDisplayElement(*this);
334 MediaControlTimeRemainingDisplayElement::Create(*this); 334 panel->AppendChild(duration_display_);
335 duration_display_ = duration_display;
336 panel->AppendChild(duration_display);
337 335
338 MediaControlTimelineElement* timeline = 336 MediaControlTimelineElement* timeline =
339 MediaControlTimelineElement::Create(*this); 337 MediaControlTimelineElement::Create(*this);
340 timeline_ = timeline; 338 timeline_ = timeline;
341 panel->AppendChild(timeline); 339 panel->AppendChild(timeline);
342 340
343 mute_button_ = new MediaControlMuteButtonElement(*this); 341 mute_button_ = new MediaControlMuteButtonElement(*this);
344 panel->AppendChild(mute_button_); 342 panel->AppendChild(mute_button_);
345 343
346 MediaControlVolumeSliderElement* slider = 344 MediaControlVolumeSliderElement* slider =
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 visitor->Trace(cast_button_); 1134 visitor->Trace(cast_button_);
1137 visitor->Trace(overlay_cast_button_); 1135 visitor->Trace(overlay_cast_button_);
1138 visitor->Trace(media_event_listener_); 1136 visitor->Trace(media_event_listener_);
1139 visitor->Trace(window_event_listener_); 1137 visitor->Trace(window_event_listener_);
1140 visitor->Trace(orientation_lock_delegate_); 1138 visitor->Trace(orientation_lock_delegate_);
1141 MediaControls::Trace(visitor); 1139 MediaControls::Trace(visitor);
1142 HTMLDivElement::Trace(visitor); 1140 HTMLDivElement::Trace(visitor);
1143 } 1141 }
1144 1142
1145 } // namespace blink 1143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698