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() { ...@@ -452,18 +452,18 @@ void MediaControlsImpl::InitializeControls() {
// relative to each other. The first item appended appears at the top of the // relative to each other. The first item appended appears at the top of the
// overflow menu. // overflow menu.
overflow_list_->AppendChild(play_button_->CreateOverflowElement( overflow_list_->AppendChild(play_button_->CreateOverflowElement(
*this, new MediaControlPlayButtonElement(*this))); new MediaControlPlayButtonElement(*this)));
overflow_list_->AppendChild(fullscreen_button_->CreateOverflowElement( overflow_list_->AppendChild(fullscreen_button_->CreateOverflowElement(
*this, new MediaControlFullscreenButtonElement(*this))); new MediaControlFullscreenButtonElement(*this)));
overflow_list_->AppendChild(download_button_->CreateOverflowElement( overflow_list_->AppendChild(download_button_->CreateOverflowElement(
*this, new MediaControlDownloadButtonElement(*this))); new MediaControlDownloadButtonElement(*this)));
overflow_list_->AppendChild(mute_button_->CreateOverflowElement( overflow_list_->AppendChild(mute_button_->CreateOverflowElement(
*this, new MediaControlMuteButtonElement(*this))); new MediaControlMuteButtonElement(*this)));
overflow_list_->AppendChild(cast_button_->CreateOverflowElement( overflow_list_->AppendChild(cast_button_->CreateOverflowElement(
*this, new MediaControlCastButtonElement(*this, false))); new MediaControlCastButtonElement(*this, false)));
overflow_list_->AppendChild( overflow_list_->AppendChild(
toggle_closed_captions_button_->CreateOverflowElement( toggle_closed_captions_button_->CreateOverflowElement(
*this, new MediaControlToggleClosedCaptionsButtonElement(*this))); new MediaControlToggleClosedCaptionsButtonElement(*this)));
} }
Node::InsertionNotificationRequest MediaControlsImpl::InsertedInto( Node::InsertionNotificationRequest MediaControlsImpl::InsertedInto(
......
...@@ -34,7 +34,6 @@ bool MediaControlInputElement::ShouldRecordDisplayStates( ...@@ -34,7 +34,6 @@ bool MediaControlInputElement::ShouldRecordDisplayStates(
} }
HTMLElement* MediaControlInputElement::CreateOverflowElement( HTMLElement* MediaControlInputElement::CreateOverflowElement(
MediaControlsImpl& media_controls,
MediaControlInputElement* button) { MediaControlInputElement* button) {
if (!button) if (!button)
return nullptr; return nullptr;
...@@ -42,11 +41,10 @@ HTMLElement* MediaControlInputElement::CreateOverflowElement( ...@@ -42,11 +41,10 @@ HTMLElement* MediaControlInputElement::CreateOverflowElement(
// We don't want the button visible within the overflow menu. // We don't want the button visible within the overflow menu.
button->SetInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); button->SetInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
overflow_menu_text_ = Text::Create(media_controls.GetDocument(), overflow_menu_text_ =
button->GetOverflowMenuString()); Text::Create(GetDocument(), button->GetOverflowMenuString());
HTMLLabelElement* element = HTMLLabelElement* element = HTMLLabelElement::Create(GetDocument());
HTMLLabelElement::Create(media_controls.GetDocument());
element->SetShadowPseudoId( element->SetShadowPseudoId(
AtomicString("-internal-media-controls-overflow-menu-list-item")); AtomicString("-internal-media-controls-overflow-menu-list-item"));
// Appending a button to a label element ensures that clicks on the label // Appending a button to a label element ensures that clicks on the label
......
...@@ -23,8 +23,7 @@ class MODULES_EXPORT MediaControlInputElement : public HTMLInputElement, ...@@ -23,8 +23,7 @@ class MODULES_EXPORT MediaControlInputElement : public HTMLInputElement,
static bool ShouldRecordDisplayStates(const HTMLMediaElement&); static bool ShouldRecordDisplayStates(const HTMLMediaElement&);
// Creates an overflow menu element with the given button as a child. // Creates an overflow menu element with the given button as a child.
HTMLElement* CreateOverflowElement(MediaControlsImpl&, HTMLElement* CreateOverflowElement(MediaControlInputElement*);
MediaControlInputElement*);
// Implements MediaControlElementBase. // Implements MediaControlElementBase.
void SetOverflowElementIsWanted(bool) final; void SetOverflowElementIsWanted(bool) final;
......
...@@ -181,7 +181,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayFallback) { ...@@ -181,7 +181,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayFallback) {
Persistent<HTMLElement> overflow_container = Persistent<HTMLElement> overflow_container =
ControlInputElement().CreateOverflowElement( ControlInputElement().CreateOverflowElement(
MediaControls(), new MediaControlInputElementImpl(MediaControls())); new MediaControlInputElementImpl(MediaControls()));
ControlInputElement().SetIsWanted(true); ControlInputElement().SetIsWanted(true);
ControlInputElement().SetDoesFit(false); ControlInputElement().SetDoesFit(false);
...@@ -198,7 +198,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayRequiresWanted) { ...@@ -198,7 +198,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayRequiresWanted) {
Persistent<HTMLElement> overflow_container = Persistent<HTMLElement> overflow_container =
ControlInputElement().CreateOverflowElement( ControlInputElement().CreateOverflowElement(
MediaControls(), new MediaControlInputElementImpl(MediaControls())); new MediaControlInputElementImpl(MediaControls()));
ControlInputElement().SetIsWanted(true); ControlInputElement().SetIsWanted(true);
ControlInputElement().SetDoesFit(false); ControlInputElement().SetDoesFit(false);
...@@ -220,7 +220,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayAfterInline) { ...@@ -220,7 +220,7 @@ TEST_F(MediaControlInputElementTest, OverflowElement_DisplayAfterInline) {
Persistent<HTMLElement> overflow_container = Persistent<HTMLElement> overflow_container =
ControlInputElement().CreateOverflowElement( ControlInputElement().CreateOverflowElement(
MediaControls(), new MediaControlInputElementImpl(MediaControls())); new MediaControlInputElementImpl(MediaControls()));
ControlInputElement().SetIsWanted(true); ControlInputElement().SetIsWanted(true);
ControlInputElement().SetDoesFit(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