| 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 // ---------------------------- | |
| 40 | |
| 41 class CORE_EXPORT MediaControlPlayButtonElement final | |
| 42 : public MediaControlInputElement { | |
| 43 public: | |
| 44 static MediaControlPlayButtonElement* Create(MediaControls&); | |
| 45 | |
| 46 bool WillRespondToMouseClickEvents() override { return true; } | |
| 47 void UpdateDisplayType() override; | |
| 48 | |
| 49 WebLocalizedString::Name GetOverflowStringName() override; | |
| 50 | |
| 51 bool HasOverflowButton() override { return true; } | |
| 52 | |
| 53 private: | |
| 54 explicit MediaControlPlayButtonElement(MediaControls&); | |
| 55 | |
| 56 void DefaultEventHandler(Event*) override; | |
| 57 }; | |
| 58 | |
| 59 // ---------------------------- | |
| 60 | |
| 61 class CORE_EXPORT MediaControlOverlayPlayButtonElement final | |
| 62 : public MediaControlInputElement { | |
| 63 public: | |
| 64 static MediaControlOverlayPlayButtonElement* Create(MediaControls&); | |
| 65 | |
| 66 void UpdateDisplayType() override; | |
| 67 | |
| 68 private: | |
| 69 explicit MediaControlOverlayPlayButtonElement(MediaControls&); | |
| 70 | |
| 71 void DefaultEventHandler(Event*) override; | |
| 72 bool KeepEventInNode(Event*) override; | |
| 73 }; | |
| 74 | |
| 75 // ---------------------------- | |
| 76 | |
| 77 class CORE_EXPORT MediaControlToggleClosedCaptionsButtonElement final | |
| 78 : public MediaControlInputElement { | |
| 79 public: | |
| 80 static MediaControlToggleClosedCaptionsButtonElement* Create(MediaControls&); | |
| 81 | |
| 82 bool WillRespondToMouseClickEvents() override { return true; } | |
| 83 | |
| 84 void UpdateDisplayType() override; | |
| 85 | |
| 86 WebLocalizedString::Name GetOverflowStringName() override; | |
| 87 | |
| 88 bool HasOverflowButton() override { return true; } | |
| 89 | |
| 90 private: | |
| 91 explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&); | |
| 92 | |
| 93 void DefaultEventHandler(Event*) override; | |
| 94 }; | |
| 95 | |
| 96 // ---------------------------- | |
| 97 | |
| 98 // Represents the overflow menu which is displayed when the width of the media | |
| 99 // player is small enough that at least two buttons are no longer visible. | |
| 100 class CORE_EXPORT MediaControlOverflowMenuButtonElement final | |
| 101 : public MediaControlInputElement { | |
| 102 public: | |
| 103 static MediaControlOverflowMenuButtonElement* Create(MediaControls&); | |
| 104 | |
| 105 // The overflow button should respond to mouse clicks since we want a click | |
| 106 // to open up the menu. | |
| 107 bool WillRespondToMouseClickEvents() override { return true; } | |
| 108 | |
| 109 private: | |
| 110 explicit MediaControlOverflowMenuButtonElement(MediaControls&); | |
| 111 | |
| 112 void DefaultEventHandler(Event*) override; | |
| 113 }; | |
| 114 | |
| 115 // ---------------------------- | |
| 116 // Represents a button that allows users to download media if the file is | 39 // Represents a button that allows users to download media if the file is |
| 117 // downloadable. | 40 // downloadable. |
| 118 class CORE_EXPORT MediaControlDownloadButtonElement final | 41 class CORE_EXPORT MediaControlDownloadButtonElement final |
| 119 : public MediaControlInputElement { | 42 : public MediaControlInputElement { |
| 120 public: | 43 public: |
| 121 static MediaControlDownloadButtonElement* Create(MediaControls&); | 44 static MediaControlDownloadButtonElement* Create(MediaControls&); |
| 122 | 45 |
| 123 WebLocalizedString::Name GetOverflowStringName() override; | 46 WebLocalizedString::Name GetOverflowStringName() override; |
| 124 | 47 |
| 125 bool HasOverflowButton() override { return true; } | 48 bool HasOverflowButton() override { return true; } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 100 |
| 178 // Width in CSS pixels * pageZoomFactor (ignores CSS transforms for | 101 // Width in CSS pixels * pageZoomFactor (ignores CSS transforms for |
| 179 // simplicity; deliberately ignores pinch zoom's pageScaleFactor). | 102 // simplicity; deliberately ignores pinch zoom's pageScaleFactor). |
| 180 int TimelineWidth(); | 103 int TimelineWidth(); |
| 181 | 104 |
| 182 MediaControlTimelineMetrics metrics_; | 105 MediaControlTimelineMetrics metrics_; |
| 183 }; | 106 }; |
| 184 | 107 |
| 185 // ---------------------------- | 108 // ---------------------------- |
| 186 | 109 |
| 187 class CORE_EXPORT MediaControlFullscreenButtonElement final | |
| 188 : public MediaControlInputElement { | |
| 189 public: | |
| 190 static MediaControlFullscreenButtonElement* Create(MediaControls&); | |
| 191 | |
| 192 bool WillRespondToMouseClickEvents() override { return true; } | |
| 193 | |
| 194 void SetIsFullscreen(bool); | |
| 195 | |
| 196 WebLocalizedString::Name GetOverflowStringName() override; | |
| 197 | |
| 198 bool HasOverflowButton() override { return true; } | |
| 199 | |
| 200 private: | |
| 201 explicit MediaControlFullscreenButtonElement(MediaControls&); | |
| 202 | |
| 203 void DefaultEventHandler(Event*) override; | |
| 204 }; | |
| 205 | |
| 206 // ---------------------------- | |
| 207 | |
| 208 class CORE_EXPORT MediaControlCastButtonElement final | 110 class CORE_EXPORT MediaControlCastButtonElement final |
| 209 : public MediaControlInputElement { | 111 : public MediaControlInputElement { |
| 210 public: | 112 public: |
| 211 static MediaControlCastButtonElement* Create(MediaControls&, | 113 static MediaControlCastButtonElement* Create(MediaControls&, |
| 212 bool is_overlay_button); | 114 bool is_overlay_button); |
| 213 | 115 |
| 214 bool WillRespondToMouseClickEvents() override { return true; } | 116 bool WillRespondToMouseClickEvents() override { return true; } |
| 215 | 117 |
| 216 void SetIsPlayingRemotely(bool); | 118 void SetIsPlayingRemotely(bool); |
| 217 | 119 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 private: | 164 private: |
| 263 explicit MediaControlVolumeSliderElement(MediaControls&); | 165 explicit MediaControlVolumeSliderElement(MediaControls&); |
| 264 | 166 |
| 265 void DefaultEventHandler(Event*) override; | 167 void DefaultEventHandler(Event*) override; |
| 266 bool KeepEventInNode(Event*) override; | 168 bool KeepEventInNode(Event*) override; |
| 267 }; | 169 }; |
| 268 | 170 |
| 269 } // namespace blink | 171 } // namespace blink |
| 270 | 172 |
| 271 #endif // MediaControlElements_h | 173 #endif // MediaControlElements_h |
| OLD | NEW |