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

Unified Diff: third_party/WebKit/Source/modules/media_controls/MediaDownloadInProductHelpManager.h

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/MediaDownloadInProductHelpManager.h
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaDownloadInProductHelpManager.h b/third_party/WebKit/Source/modules/media_controls/MediaDownloadInProductHelpManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..3c5e093cb8b52fa84a7ead46b6e520c0438786fc
--- /dev/null
+++ b/third_party/WebKit/Source/modules/media_controls/MediaDownloadInProductHelpManager.h
@@ -0,0 +1,52 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MediaDownloadInProductHelpManager_h
+#define MediaDownloadInProductHelpManager_h
+
+#include <memory>
+
+#include "modules/ModulesExport.h"
+#include "platform/heap/GarbageCollected.h"
+#include "platform/heap/Heap.h"
+#include "platform/heap/Member.h"
+#include "public/platform/media_download_in_product_help.mojom-blink.h"
+
+namespace blink {
+class MediaControlsImpl;
+
+class MODULES_EXPORT MediaDownloadInProductHelpManager final
+ : public GarbageCollectedFinalized<MediaDownloadInProductHelpManager> {
+ WTF_MAKE_NONCOPYABLE(MediaDownloadInProductHelpManager);
+
+ public:
+ explicit MediaDownloadInProductHelpManager(MediaControlsImpl&);
+ virtual ~MediaDownloadInProductHelpManager();
+
+ void SetControlsVisibility(bool can_show);
+ void SetDownloadButtonVisibility(bool can_show);
+ void SetIsPlaying(bool is_playing);
+ bool IsShowingInProductHelp() const;
+
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ void StateUpdated();
+ bool CanShowInProductHelp() const;
+ void MaybeDispatchDownloadInProductHelpTrigger();
+ void DismissInProductHelp();
+
+ Member<MediaControlsImpl> controls_;
+
+ bool controls_can_show_ = false;
+ bool button_can_show_ = false;
+ bool is_playing_ = false;
+ bool media_download_in_product_trigger_observed_ = false;
+
+ mojom::blink::MediaDownloadInProductHelpPtr media_in_product_help_;
+};
+
+} // namespace blink
+
+#endif // MediaDownloadInProductHelpManager_h

Powered by Google App Engine
This is Rietveld 408576698