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 MediaDownloadInProductHelpManager_h | |
6 #define MediaDownloadInProductHelpManager_h | |
7 | |
8 #include <memory> | |
9 | |
10 #include "modules/ModulesExport.h" | |
11 #include "platform/heap/GarbageCollected.h" | |
12 #include "platform/heap/Heap.h" | |
13 #include "platform/heap/Member.h" | |
14 #include "public/platform/media_download_in_product_help.mojom-blink.h" | |
15 | |
16 namespace blink { | |
17 class MediaControlsImpl; | |
18 | |
19 class MODULES_EXPORT MediaDownloadInProductHelpManager final | |
20 : public GarbageCollectedFinalized<MediaDownloadInProductHelpManager> { | |
21 WTF_MAKE_NONCOPYABLE(MediaDownloadInProductHelpManager); | |
22 | |
23 public: | |
24 MediaDownloadInProductHelpManager(MediaControlsImpl&); | |
dcheng
2017/08/19 00:30:15
Nit: explicit
Khushal
2017/08/21 23:27:34
Done.
| |
25 virtual ~MediaDownloadInProductHelpManager(); | |
26 | |
27 void SetControlsVisibility(bool can_show); | |
28 void SetDownloadButtonVisibility(bool can_show); | |
29 void SetIsPlaying(bool is_playing); | |
30 bool IsShowingInProductHelp() const; | |
31 | |
32 DECLARE_VIRTUAL_TRACE(); | |
33 | |
34 private: | |
35 void StateUpdated(); | |
36 bool CanShowInProductHelp() const; | |
37 void MaybeDispatchDownloadInProductHelpTrigger(); | |
38 void DismissInProductHelp(); | |
39 | |
40 Member<MediaControlsImpl> controls_; | |
41 | |
42 bool controls_can_show_ = false; | |
43 bool button_can_show_ = false; | |
44 bool is_playing_ = false; | |
45 bool media_download_in_product_trigger_observed_ = false; | |
46 | |
47 std::unique_ptr<mojom::blink::MediaDownloadInProductHelpPtr> | |
dcheng
2017/08/19 00:30:15
No need to wrap the interface pointer in a unique_
Khushal
2017/08/21 23:27:34
Done.
| |
48 media_in_product_help_; | |
49 }; | |
50 | |
51 } // namespace blink | |
52 | |
53 #endif // MediaDownloadInProductHelpManager_h | |
OLD | NEW |