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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.h

Issue 2820343002: Media Controls: move timeline related code to modules. (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) 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 13 matching lines...) Expand all
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
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"
35 34
36 namespace blink { 35 namespace blink {
37 36
38 class CORE_EXPORT MediaControlTimelineElement final
39 : public MediaControlInputElement {
40 public:
41 static MediaControlTimelineElement* Create(MediaControls&);
42
43 bool WillRespondToMouseClickEvents() override;
44
45 // FIXME: An "earliest possible position" will be needed once that concept
46 // is supported by HTMLMediaElement, see https://crbug.com/137275
47 void SetPosition(double);
48 void SetDuration(double);
49
50 void OnPlaying();
51
52 private:
53 explicit MediaControlTimelineElement(MediaControls&);
54
55 void DefaultEventHandler(Event*) override;
56 bool KeepEventInNode(Event*) override;
57
58 // Width in CSS pixels * pageZoomFactor (ignores CSS transforms for
59 // simplicity; deliberately ignores pinch zoom's pageScaleFactor).
60 int TimelineWidth();
61
62 MediaControlTimelineMetrics metrics_;
63 };
64
65 // ----------------------------
66
67 class CORE_EXPORT MediaControlVolumeSliderElement final 37 class CORE_EXPORT MediaControlVolumeSliderElement final
68 : public MediaControlInputElement { 38 : public MediaControlInputElement {
69 public: 39 public:
70 static MediaControlVolumeSliderElement* Create(MediaControls&); 40 static MediaControlVolumeSliderElement* Create(MediaControls&);
71 41
72 bool WillRespondToMouseMoveEvents() override; 42 bool WillRespondToMouseMoveEvents() override;
73 bool WillRespondToMouseClickEvents() override; 43 bool WillRespondToMouseClickEvents() override;
74 void SetVolume(double); 44 void SetVolume(double);
75 45
76 private: 46 private:
77 explicit MediaControlVolumeSliderElement(MediaControls&); 47 explicit MediaControlVolumeSliderElement(MediaControls&);
78 48
79 void DefaultEventHandler(Event*) override; 49 void DefaultEventHandler(Event*) override;
80 bool KeepEventInNode(Event*) override; 50 bool KeepEventInNode(Event*) override;
81 }; 51 };
82 52
83 } // namespace blink 53 } // namespace blink
84 54
85 #endif // MediaControlElements_h 55 #endif // MediaControlElements_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698