OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_RENDERER_MEDIA_MEDIA_IPH_IMPL_H_ |
| 6 #define CHROME_RENDERER_MEDIA_MEDIA_IPH_IMPL_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/common/media_iph.mojom.h" |
| 10 #include "services/service_manager/public/cpp/bind_source_info.h" |
| 11 #include "third_party/WebKit/public/web/WebMediaIPH.h" |
| 12 |
| 13 namespace content { |
| 14 class RenderFrame; |
| 15 } // namespace content |
| 16 |
| 17 class MediaIPHImpl : public blink::WebMediaIPH { |
| 18 public: |
| 19 explicit MediaIPHImpl(content::RenderFrame* render_frame); |
| 20 ~MediaIPHImpl() override; |
| 21 |
| 22 // blink::WebMediaIPH implementation. |
| 23 void BindToClient(blink::WebMediaIPHClient*) override; |
| 24 void ShowMediaDownloadIPH(const blink::WebRect&) override; |
| 25 void HideMediaDownloadIPH() override; |
| 26 |
| 27 private: |
| 28 class MediaIPHDelegateService; |
| 29 |
| 30 void CreateDelegateService( |
| 31 const service_manager::BindSourceInfo& source_info, |
| 32 chrome::mojom::MediaIPHDelegateServiceRequest request); |
| 33 void IPHWidgetDismissed(); |
| 34 |
| 35 content::RenderFrame* render_frame_; |
| 36 bool iph_active_ = false; |
| 37 blink::WebMediaIPHClient* client_ = nullptr; |
| 38 base::WeakPtrFactory<MediaIPHImpl> weak_factory_; |
| 39 }; |
| 40 |
| 41 #endif // CHROME_RENDERER_MEDIA_MEDIA_IPH_IMPL_H_ |
OLD | NEW |