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

Unified Diff: third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp

Issue 2943983003: chrome/blink: Add functionality for in-product help for media elements. (Closed)
Patch Set: .. Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp
diff --git a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp
index f7a9f8f05c581e16d097cdb60ff5599fbb36acc9..221f127733d9d431eb4339bdf47be9518201bb2e 100644
--- a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp
+++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp
@@ -13,6 +13,7 @@
#include "core/html/media/HTMLMediaSource.h"
#include "core/page/Page.h"
#include "modules/media_controls/MediaControlsImpl.h"
+#include "modules/media_controls/MediaDownloadInProductHelpManager.h"
#include "public/platform/Platform.h"
namespace blink {
@@ -93,6 +94,15 @@ const char* MediaControlDownloadButtonElement::GetNameForHistograms() const {
return IsOverflowElement() ? "DownloadOverflowButton" : "DownloadButton";
}
+void MediaControlDownloadButtonElement::UpdateShownState() {
+ MediaControlInputElement::UpdateShownState();
+
+ if (GetMediaControls().DownloadInProductHelp()) {
+ GetMediaControls().DownloadInProductHelp()->SetDownloadButtonVisibility(
+ IsWanted() && DoesFit());
+ }
+}
+
void MediaControlDownloadButtonElement::DefaultEventHandler(Event* event) {
const KURL& url = MediaElement().currentSrc();
if (event->type() == EventTypeNames::click &&

Powered by Google App Engine
This is Rietveld 408576698