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

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: move IPH to MediaDownloadInProductManager 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..a1e8fe99122138700c18d6148cd88c203e72a56f 100644
--- a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp
+++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp
@@ -6,6 +6,7 @@
#include "core/InputTypeNames.h"
#include "core/events/Event.h"
+#include "core/frame/LocalFrameClient.h"
mlamouri (slow - plz ping) 2017/08/16 13:09:30 Looks like you don't need this include anymore.
Khushal 2017/08/16 19:01:23 Done.
#include "core/frame/Settings.h"
#include "core/html/HTMLAnchorElement.h"
#include "core/html/HTMLMediaElement.h"
@@ -13,6 +14,8 @@
#include "core/html/media/HTMLMediaSource.h"
#include "core/page/Page.h"
#include "modules/media_controls/MediaControlsImpl.h"
+#include "modules/media_controls/MediaDownloadInProductHelpManager.h"
+#include "platform/wtf/Functional.h"
mlamouri (slow - plz ping) 2017/08/16 13:09:30 Do you still need Functional.h?
Khushal 2017/08/16 19:01:22 Nope.
#include "public/platform/Platform.h"
namespace blink {
@@ -93,6 +96,15 @@ const char* MediaControlDownloadButtonElement::GetNameForHistograms() const {
return IsOverflowElement() ? "DownloadOverflowButton" : "DownloadButton";
}
+void MediaControlDownloadButtonElement::UpdateShownState() {
+ MediaControlInputElement::UpdateShownState();
+
+ auto* iph_manager = static_cast<MediaControlsImpl&>(GetMediaControls())
mlamouri (slow - plz ping) 2017/08/16 13:09:30 You shouldn't have to static_cast anymore. Also, d
Khushal 2017/08/16 19:01:22 That's great. Remove the auto. I had it earlier be
+ .DownloadInProductHelp();
+ if (iph_manager)
+ iph_manager->SetDownloadButtonState(IsWanted() && DoesFit());
mlamouri (slow - plz ping) 2017/08/16 13:09:30 Maybe you should call this `SetDownloadButtonVisib
Khushal 2017/08/16 19:01:23 Done.
+}
+
void MediaControlDownloadButtonElement::DefaultEventHandler(Event* event) {
const KURL& url = MediaElement().currentSrc();
if (event->type() == EventTypeNames::click &&

Powered by Google App Engine
This is Rietveld 408576698