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

Side by Side Diff: Source/core/html/shadow/MediaControlElementTypes.h

Issue 1156993013: New media playback UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: cl feedback, rebased. Created 5 years, 4 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 CORE_EXPORT HTMLMediaElement* toParentMediaElement(Node*); 70 CORE_EXPORT HTMLMediaElement* toParentMediaElement(Node*);
71 inline HTMLMediaElement* toParentMediaElement(LayoutObject* layoutObject) { retu rn toParentMediaElement(layoutObject->node()); } 71 inline HTMLMediaElement* toParentMediaElement(LayoutObject* layoutObject) { retu rn toParentMediaElement(layoutObject->node()); }
72 72
73 CORE_EXPORT MediaControlElementType mediaControlElementType(Node*); 73 CORE_EXPORT MediaControlElementType mediaControlElementType(Node*);
74 74
75 // ---------------------------- 75 // ----------------------------
76 76
77 class MediaControlElement : public WillBeGarbageCollectedMixin { 77 class MediaControlElement : public WillBeGarbageCollectedMixin {
78 public: 78 public:
79 void hide(); 79 // These hold the state about whether this control should be shown if
80 void show(); 80 // space permits. These will also show / hide as needed.
81 void setIsWanted(bool);
82 bool isWanted();
83
84 // Tell us whether we fit or not. This will hide / show the control as
85 // needed, also.
86 void setDoesFit(bool);
87
88 // This returns the minimum width in pixels that we need to show
89 // this control. Ideally, this would just be shorthand for the computed
90 // style, but this must also work when the control is hidden.
91 int minimumWidth();
liberato (no reviews please) 2015/08/04 15:07:00 in cases where the bar had between 48 and 54 pixel
81 92
82 MediaControlElementType displayType() { return m_displayType; } 93 MediaControlElementType displayType() { return m_displayType; }
83 94
84 DECLARE_VIRTUAL_TRACE(); 95 DECLARE_VIRTUAL_TRACE();
85 96
86 protected: 97 protected:
87 MediaControlElement(MediaControls&, MediaControlElementType, HTMLElement*); 98 MediaControlElement(MediaControls&, MediaControlElementType, HTMLElement*);
88 99
89 MediaControls& mediaControls() const { return m_mediaControls; } 100 MediaControls& mediaControls() const { return m_mediaControls; }
90 HTMLMediaElement& mediaElement() const; 101 HTMLMediaElement& mediaElement() const;
91 102
92 void setDisplayType(MediaControlElementType); 103 void setDisplayType(MediaControlElementType);
93 104
94 private: 105 private:
106 // Hide or show based on our fits / wanted state. We want to show
107 // if and only if we're wanted and we fit.
108 void updateShownState();
109
95 MediaControls& m_mediaControls; 110 MediaControls& m_mediaControls;
96 MediaControlElementType m_displayType; 111 MediaControlElementType m_displayType;
97 RawPtrWillBeMember<HTMLElement> m_element; 112 RawPtrWillBeMember<HTMLElement> m_element;
113 bool m_isWanted : 1;
114 bool m_doesFit : 1;
98 }; 115 };
99 116
100 // ---------------------------- 117 // ----------------------------
101 118
102 class MediaControlDivElement : public HTMLDivElement, public MediaControlElement { 119 class MediaControlDivElement : public HTMLDivElement, public MediaControlElement {
103 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaControlDivElement); 120 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaControlDivElement);
104 public: 121 public:
105 DECLARE_VIRTUAL_TRACE(); 122 DECLARE_VIRTUAL_TRACE();
106 123
107 protected: 124 protected:
(...skipping 29 matching lines...) Expand all
137 protected: 154 protected:
138 MediaControlTimeDisplayElement(MediaControls&, MediaControlElementType); 155 MediaControlTimeDisplayElement(MediaControls&, MediaControlElementType);
139 156
140 private: 157 private:
141 double m_currentValue; 158 double m_currentValue;
142 }; 159 };
143 160
144 } // namespace blink 161 } // namespace blink
145 162
146 #endif // MediaControlElementTypes_h 163 #endif // MediaControlElementTypes_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698