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

Unified Diff: chrome/renderer/media/media_iph_impl.h

Issue 2943983003: chrome/blink: Add functionality for in-product help for media elements. (Closed)
Patch Set: Created 3 years, 6 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: chrome/renderer/media/media_iph_impl.h
diff --git a/chrome/renderer/media/media_iph_impl.h b/chrome/renderer/media/media_iph_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..f4101b91e78438c05c4486ae45caeb845d6afb3f
--- /dev/null
+++ b/chrome/renderer/media/media_iph_impl.h
@@ -0,0 +1,41 @@
+// 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 CHROME_RENDERER_MEDIA_MEDIA_IPH_IMPL_H_
+#define CHROME_RENDERER_MEDIA_MEDIA_IPH_IMPL_H_
+
+#include "base/memory/weak_ptr.h"
+#include "chrome/common/media_iph.mojom.h"
+#include "services/service_manager/public/cpp/bind_source_info.h"
+#include "third_party/WebKit/public/web/WebMediaIPH.h"
+
+namespace content {
+class RenderFrame;
+} // namespace content
+
+class MediaIPHImpl : public blink::WebMediaIPH {
+ public:
+ explicit MediaIPHImpl(content::RenderFrame* render_frame);
+ ~MediaIPHImpl() override;
+
+ // blink::WebMediaIPH implementation.
+ void BindToClient(blink::WebMediaIPHClient*) override;
+ void ShowMediaDownloadIPH(const blink::WebRect&) override;
+ void HideMediaDownloadIPH() override;
+
+ private:
+ class MediaIPHDelegateService;
+
+ void CreateDelegateService(
+ const service_manager::BindSourceInfo& source_info,
+ chrome::mojom::MediaIPHDelegateServiceRequest request);
+ void IPHWidgetDismissed();
+
+ content::RenderFrame* render_frame_;
+ bool iph_active_ = false;
+ blink::WebMediaIPHClient* client_ = nullptr;
+ base::WeakPtrFactory<MediaIPHImpl> weak_factory_;
+};
+
+#endif // CHROME_RENDERER_MEDIA_MEDIA_IPH_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698