Commit b9ae8287 authored by Mounir Lamouri's avatar Mounir Lamouri Committed by Commit Bot

Remove MediaControlsImpl parameter for overflow button creation.

Bug: None
Change-Id: I783dd4dca9928874fbfa97481404595b7dc6253a
Reviewed-on: https://chromium-review.googlesource.com/571749
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarJennifer Apacible <apacible@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487303}
parent e73f80a0
......@@ -452,18 +452,18 @@ void MediaControlsImpl::InitializeControls() {
// relative to each other. The first item appended appears at the top of the
// overflow menu.
overflow_list_->AppendChild(play_button_->CreateOverflowElement(
*this, new MediaControlPlayButtonElement(*this)));
new MediaControlPlayButtonElement(*this)));
overflow_list_->AppendChild(fullscreen_button_->CreateOverflowElement(
*this, new MediaControlFullscreenButtonElement(*this)));
new MediaControlFullscreenButtonElement(*this)));
overflow_list_->AppendChild(download_button_->CreateOverflowElement(
*this, new MediaControlDownloadButtonElement(*this)));
new MediaControlDownloadButtonElement(*this)));
overflow_list_->AppendChild(mute_button_->CreateOverflowElement(
*this, new MediaControlMuteButtonElement(*this)));
new MediaControlMuteButtonElement(*this)));
overflow_list_->AppendChild(cast_button_->CreateOverflowElement(
*this, new MediaControlCastButtonElement(*this, false)));
new MediaControlCastButtonElement(*this, false)));
overflow_list_->AppendChild(
toggle_closed_captions_button_->CreateOverflowElement(
*this, new MediaControlToggleClosedCaptionsButtonElement(*this)));
new MediaControlToggleClosedCaptionsButtonElement(*this)));
}
Node::InsertionNotificationRequest MediaControlsImpl::InsertedInto(
......
......@@ -34,7 +34,6 @@ bool MediaControlInputElement::ShouldRecordDisplayStates(
}
HTMLElement* MediaControlInputElement::CreateOverflowElement(
MediaControlsImpl& media_controls,
MediaControlInputElement* button) {
if (!button)
return nullptr;
......@@ -42,11 +41,10 @@ HTMLElement* MediaControlInputElement::CreateOverflowElement(
// We don't want the button visible within the overflow menu.
button->SetInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
overflow_menu_text_ = Text::Create(media_controls.GetDocument(),
button->GetOverflowMenuString());
overflow_menu_text_ =
Text::Create(GetDocument(), button->GetOverflowMenuString());
HTMLLabelElement* element =
HTMLLabelElement::Create(media_controls.GetDocument());
HTMLLabelElement* element = HTMLLabelElement::Create(GetDocument());
element->SetShadowPseudoId(
AtomicString("-internal-media-controls-overflow-menu-list-item"));
// Appending a button to a label element ensures that clicks on the label
......
......@@ -23,8 +23,7 @@ class MODULES_EXPORT MediaControlInputElement : public HTMLInputElement,
static bool ShouldRecordDisplayStates(const HTMLMediaElement&);
// Creates an overflow menu element with the given button as a child.
HTMLElement* CreateOverflowElement(MediaControlsImpl&,
MediaControlInputElement*);
HTMLElement* CreateOverflowElement(MediaControlInputElement*);
// Implements MediaControlElementBase.
void SetOverflowElementIsWanted(bool) final;
......
......@@ -181,7 +181,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayFallback) {
Persistent<HTMLElement> overflow_container =
ControlInputElement().CreateOverflowElement(
MediaControls(), new MediaControlInputElementImpl(MediaControls()));
new MediaControlInputElementImpl(MediaControls()));
ControlInputElement().SetIsWanted(true);
ControlInputElement().SetDoesFit(false);
......@@ -198,7 +198,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayRequiresWanted) {
Persistent<HTMLElement> overflow_container =
ControlInputElement().CreateOverflowElement(
MediaControls(), new MediaControlInputElementImpl(MediaControls()));
new MediaControlInputElementImpl(MediaControls()));
ControlInputElement().SetIsWanted(true);
ControlInputElement().SetDoesFit(false);
......@@ -220,7 +220,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayAfterInline) {
Persistent<HTMLElement> overflow_container =
ControlInputElement().CreateOverflowElement(
MediaControls(), new MediaControlInputElementImpl(MediaControls()));
new MediaControlInputElementImpl(MediaControls()));
ControlInputElement().SetIsWanted(true);
ControlInputElement().SetDoesFit(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment