| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #ifndef MediaControlElements_h | 30 #ifndef MediaControlElements_h |
| 31 #define MediaControlElements_h | 31 #define MediaControlElements_h |
| 32 | 32 |
| 33 #include "core/html/shadow/MediaControlElementTypes.h" | 33 #include "core/html/shadow/MediaControlElementTypes.h" |
| 34 #include "core/html/shadow/MediaControlTimelineMetrics.h" | 34 #include "core/html/shadow/MediaControlTimelineMetrics.h" |
| 35 #include "public/platform/WebLocalizedString.h" | 35 #include "public/platform/WebLocalizedString.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class TextTrack; | |
| 40 | |
| 41 // ---------------------------- | |
| 42 | |
| 43 class CORE_EXPORT MediaControlPanelElement final | |
| 44 : public MediaControlDivElement { | |
| 45 public: | |
| 46 static MediaControlPanelElement* Create(MediaControls&); | |
| 47 | |
| 48 void SetIsDisplayed(bool); | |
| 49 | |
| 50 bool IsOpaque() const; | |
| 51 void MakeOpaque(); | |
| 52 void MakeTransparent(); | |
| 53 | |
| 54 private: | |
| 55 explicit MediaControlPanelElement(MediaControls&); | |
| 56 | |
| 57 void DefaultEventHandler(Event*) override; | |
| 58 bool KeepEventInNode(Event*) override; | |
| 59 | |
| 60 void StartTimer(); | |
| 61 void StopTimer(); | |
| 62 void TransitionTimerFired(TimerBase*); | |
| 63 void DidBecomeVisible(); | |
| 64 | |
| 65 bool is_displayed_; | |
| 66 bool opaque_; | |
| 67 | |
| 68 TaskRunnerTimer<MediaControlPanelElement> transition_timer_; | |
| 69 }; | |
| 70 | |
| 71 // ---------------------------- | 39 // ---------------------------- |
| 72 | 40 |
| 73 class CORE_EXPORT MediaControlPlayButtonElement final | 41 class CORE_EXPORT MediaControlPlayButtonElement final |
| 74 : public MediaControlInputElement { | 42 : public MediaControlInputElement { |
| 75 public: | 43 public: |
| 76 static MediaControlPlayButtonElement* Create(MediaControls&); | 44 static MediaControlPlayButtonElement* Create(MediaControls&); |
| 77 | 45 |
| 78 bool WillRespondToMouseClickEvents() override { return true; } | 46 bool WillRespondToMouseClickEvents() override { return true; } |
| 79 void UpdateDisplayType() override; | 47 void UpdateDisplayType() override; |
| 80 | 48 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 bool HasOverflowButton() override { return true; } | 88 bool HasOverflowButton() override { return true; } |
| 121 | 89 |
| 122 private: | 90 private: |
| 123 explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&); | 91 explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&); |
| 124 | 92 |
| 125 void DefaultEventHandler(Event*) override; | 93 void DefaultEventHandler(Event*) override; |
| 126 }; | 94 }; |
| 127 | 95 |
| 128 // ---------------------------- | 96 // ---------------------------- |
| 129 | 97 |
| 130 class CORE_EXPORT MediaControlTextTrackListElement final | |
| 131 : public MediaControlDivElement { | |
| 132 public: | |
| 133 static MediaControlTextTrackListElement* Create(MediaControls&); | |
| 134 | |
| 135 bool WillRespondToMouseClickEvents() override { return true; } | |
| 136 | |
| 137 void SetVisible(bool); | |
| 138 | |
| 139 private: | |
| 140 explicit MediaControlTextTrackListElement(MediaControls&); | |
| 141 | |
| 142 void DefaultEventHandler(Event*) override; | |
| 143 | |
| 144 void RefreshTextTrackListMenu(); | |
| 145 | |
| 146 // Returns the label for the track when a valid track is passed in and "Off" | |
| 147 // when the parameter is null. | |
| 148 String GetTextTrackLabel(TextTrack*); | |
| 149 // Creates the track element in the list when a valid track is passed in and | |
| 150 // the "Off" item when the parameter is null. | |
| 151 Element* CreateTextTrackListItem(TextTrack*); | |
| 152 }; | |
| 153 | |
| 154 // ---------------------------- | |
| 155 // Represents the overflow menu which is displayed when the width of the media | 98 // Represents the overflow menu which is displayed when the width of the media |
| 156 // player is small enough that at least two buttons are no longer visible. | 99 // player is small enough that at least two buttons are no longer visible. |
| 157 class CORE_EXPORT MediaControlOverflowMenuButtonElement final | 100 class CORE_EXPORT MediaControlOverflowMenuButtonElement final |
| 158 : public MediaControlInputElement { | 101 : public MediaControlInputElement { |
| 159 public: | 102 public: |
| 160 static MediaControlOverflowMenuButtonElement* Create(MediaControls&); | 103 static MediaControlOverflowMenuButtonElement* Create(MediaControls&); |
| 161 | 104 |
| 162 // The overflow button should respond to mouse clicks since we want a click | 105 // The overflow button should respond to mouse clicks since we want a click |
| 163 // to open up the menu. | 106 // to open up the menu. |
| 164 bool WillRespondToMouseClickEvents() override { return true; } | 107 bool WillRespondToMouseClickEvents() override { return true; } |
| 165 | 108 |
| 166 private: | 109 private: |
| 167 explicit MediaControlOverflowMenuButtonElement(MediaControls&); | 110 explicit MediaControlOverflowMenuButtonElement(MediaControls&); |
| 168 | 111 |
| 169 void DefaultEventHandler(Event*) override; | 112 void DefaultEventHandler(Event*) override; |
| 170 }; | 113 }; |
| 171 | 114 |
| 172 // ---------------------------- | 115 // ---------------------------- |
| 173 // Holds a list of elements within the overflow menu. | |
| 174 class CORE_EXPORT MediaControlOverflowMenuListElement final | |
| 175 : public MediaControlDivElement { | |
| 176 public: | |
| 177 static MediaControlOverflowMenuListElement* Create(MediaControls&); | |
| 178 | |
| 179 private: | |
| 180 explicit MediaControlOverflowMenuListElement(MediaControls&); | |
| 181 | |
| 182 void DefaultEventHandler(Event*) override; | |
| 183 }; | |
| 184 | |
| 185 // ---------------------------- | |
| 186 // Represents a button that allows users to download media if the file is | 116 // Represents a button that allows users to download media if the file is |
| 187 // downloadable. | 117 // downloadable. |
| 188 class CORE_EXPORT MediaControlDownloadButtonElement final | 118 class CORE_EXPORT MediaControlDownloadButtonElement final |
| 189 : public MediaControlInputElement { | 119 : public MediaControlInputElement { |
| 190 public: | 120 public: |
| 191 static MediaControlDownloadButtonElement* Create(MediaControls&); | 121 static MediaControlDownloadButtonElement* Create(MediaControls&); |
| 192 | 122 |
| 193 WebLocalizedString::Name GetOverflowStringName() override; | 123 WebLocalizedString::Name GetOverflowStringName() override; |
| 194 | 124 |
| 195 bool HasOverflowButton() override { return true; } | 125 bool HasOverflowButton() override { return true; } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 private: | 262 private: |
| 333 explicit MediaControlVolumeSliderElement(MediaControls&); | 263 explicit MediaControlVolumeSliderElement(MediaControls&); |
| 334 | 264 |
| 335 void DefaultEventHandler(Event*) override; | 265 void DefaultEventHandler(Event*) override; |
| 336 bool KeepEventInNode(Event*) override; | 266 bool KeepEventInNode(Event*) override; |
| 337 }; | 267 }; |
| 338 | 268 |
| 339 } // namespace blink | 269 } // namespace blink |
| 340 | 270 |
| 341 #endif // MediaControlElements_h | 271 #endif // MediaControlElements_h |
| OLD | NEW |