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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.h

Issue 2811703002: Move a few media controls elements into modules/media_controls/elements/. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 20 matching lines...) Expand all
31 #include "core/html/media/MediaControls.h" 31 #include "core/html/media/MediaControls.h"
32 #include "core/html/shadow/MediaControlElements.h" 32 #include "core/html/shadow/MediaControlElements.h"
33 #include "modules/ModulesExport.h" 33 #include "modules/ModulesExport.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class Event; 37 class Event;
38 class MediaControlsMediaEventListener; 38 class MediaControlsMediaEventListener;
39 class MediaControlsOrientationLockDelegate; 39 class MediaControlsOrientationLockDelegate;
40 class MediaControlsWindowEventListener; 40 class MediaControlsWindowEventListener;
41 class MediaControlMuteButtonElement;
42 class MediaControlOverlayEnclosureElement;
43 class MediaControlPanelEnclosureElement;
41 class ShadowRoot; 44 class ShadowRoot;
42 45
43 // Default implementation of the core/ MediaControls interface used by 46 // Default implementation of the core/ MediaControls interface used by
44 // HTMLMediaElement. 47 // HTMLMediaElement.
45 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement, 48 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement,
46 public MediaControls { 49 public MediaControls {
47 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl); 50 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl);
48 WTF_MAKE_NONCOPYABLE(MediaControlsImpl); 51 WTF_MAKE_NONCOPYABLE(MediaControlsImpl);
49 52
50 public: 53 public:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 MediaControlPanelElement* PanelElement() override { return panel_; } 92 MediaControlPanelElement* PanelElement() override { return panel_; }
90 void BeginScrubbing() override; 93 void BeginScrubbing() override;
91 void EndScrubbing() override; 94 void EndScrubbing() override;
92 void UpdateCurrentTimeDisplay() override; 95 void UpdateCurrentTimeDisplay() override;
93 void ToggleTextTrackList() override; 96 void ToggleTextTrackList() override;
94 void ShowTextTrackAtIndex(unsigned) override; 97 void ShowTextTrackAtIndex(unsigned) override;
95 void DisableShowingTextTracks() override; 98 void DisableShowingTextTracks() override;
96 // Called by the fullscreen buttons to toggle fulllscreen on/off. 99 // Called by the fullscreen buttons to toggle fulllscreen on/off.
97 void EnterFullscreen() override; 100 void EnterFullscreen() override;
98 void ExitFullscreen() override; 101 void ExitFullscreen() override;
99 void ShowOverlayCastButtonIfNeeded() override;
100 void ToggleOverflowMenu() override; 102 void ToggleOverflowMenu() override;
101 bool OverflowMenuVisible() override; 103 bool OverflowMenuVisible() override;
102 // TODO(mlamouri): this method is needed in order to notify the controls that 104 // TODO(mlamouri): this method is needed in order to notify the controls that
103 // the `MediaControlsEnabled` setting has changed. 105 // the `MediaControlsEnabled` setting has changed.
104 void OnMediaControlsEnabledChange() override { 106 void OnMediaControlsEnabledChange() override {
105 // There is no update because only the overlay is expected to change. 107 // There is no update because only the overlay is expected to change.
106 RefreshCastButtonVisibilityWithoutUpdate(); 108 RefreshCastButtonVisibilityWithoutUpdate();
107 } 109 }
108 Document& OwnerDocument() { return GetDocument(); } 110 Document& OwnerDocument() { return GetDocument(); }
109 111
112 void ShowOverlayCastButtonIfNeeded();
113
110 DECLARE_VIRTUAL_TRACE(); 114 DECLARE_VIRTUAL_TRACE();
111 115
112 private: 116 private:
113 // MediaControlsMediaEventListener is a component that is listening to events 117 // MediaControlsMediaEventListener is a component that is listening to events
114 // and calling the appropriate callback on MediaControlsImpl. The object is 118 // and calling the appropriate callback on MediaControlsImpl. The object is
115 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In 119 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In
116 // order to not expose accessors only for this component, a friendship is 120 // order to not expose accessors only for this component, a friendship is
117 // declared. 121 // declared.
118 friend class MediaControlsMediaEventListener; 122 friend class MediaControlsMediaEventListener;
119 // Same as above but handles the menus hiding when the window is interacted 123 // Same as above but handles the menus hiding when the window is interacted
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 IntSize size_; 239 IntSize size_;
236 240
237 bool keep_showing_until_timer_fires_ : 1; 241 bool keep_showing_until_timer_fires_ : 1;
238 }; 242 };
239 243
240 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); 244 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls());
241 245
242 } // namespace blink 246 } // namespace blink
243 247
244 #endif 248 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698