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

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: fixed some tests from previous CL. Created 5 years, 5 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 }; 68 };
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 private:
philipj_slow 2015/07/09 08:56:09 Move these things to the private section at the bo
liberato (no reviews please) 2015/07/09 22:35:33 Done.
79 void hide(); 79 void hide();
80 void show(); 80 void show();
81 81
82 // hide() or show() based on our fits / wanted state. We want to show()
83 // if an only if we're wanted and we fit.
84 void updateShownState();
85
86 public:
87 bool isShown();
88
89 // These hold the state about whether this control should be shown if
90 // space permits. These will also show / hide as needed.
91 void setIsWanted(bool);
92 bool isWanted();
93
94 // Tell us whether we fit or not. This will hide / show the control as
95 // needed, also.
96 void setDoesFit(bool);
97
98 // This returns the minimum width in pixels that we need to show
99 // this control. Ideally, this would just be shorthand for the computed
100 // style, but this must also work when the control is hidden.
101 int minimumWidth();
102
82 MediaControlElementType displayType() { return m_displayType; } 103 MediaControlElementType displayType() { return m_displayType; }
83 104
84 DECLARE_VIRTUAL_TRACE(); 105 DECLARE_VIRTUAL_TRACE();
85 106
86 protected: 107 protected:
87 MediaControlElement(MediaControls&, MediaControlElementType, HTMLElement*); 108 MediaControlElement(MediaControls&, MediaControlElementType, HTMLElement*);
88 109
89 MediaControls& mediaControls() const { return m_mediaControls; } 110 MediaControls& mediaControls() const { return m_mediaControls; }
90 HTMLMediaElement& mediaElement() const; 111 HTMLMediaElement& mediaElement() const;
91 112
92 void setDisplayType(MediaControlElementType); 113 void setDisplayType(MediaControlElementType);
93 114
94 private: 115 private:
95 MediaControls& m_mediaControls; 116 MediaControls& m_mediaControls;
96 MediaControlElementType m_displayType; 117 MediaControlElementType m_displayType;
97 RawPtrWillBeMember<HTMLElement> m_element; 118 RawPtrWillBeMember<HTMLElement> m_element;
119 bool m_isShown;
philipj_slow 2015/07/09 08:56:09 Does this always equal m_isWanted && m_doesFit? If
liberato (no reviews please) 2015/07/09 22:35:33 Done.
120 bool m_isWanted;
121 bool m_doesFit;
98 }; 122 };
99 123
100 // ---------------------------- 124 // ----------------------------
101 125
102 class MediaControlDivElement : public HTMLDivElement, public MediaControlElement { 126 class MediaControlDivElement : public HTMLDivElement, public MediaControlElement {
103 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaControlDivElement); 127 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaControlDivElement);
104 public: 128 public:
105 DECLARE_VIRTUAL_TRACE(); 129 DECLARE_VIRTUAL_TRACE();
106 130
107 protected: 131 protected:
(...skipping 29 matching lines...) Expand all
137 protected: 161 protected:
138 MediaControlTimeDisplayElement(MediaControls&, MediaControlElementType); 162 MediaControlTimeDisplayElement(MediaControls&, MediaControlElementType);
139 163
140 private: 164 private:
141 double m_currentValue; 165 double m_currentValue;
142 }; 166 };
143 167
144 } // namespace blink 168 } // namespace blink
145 169
146 #endif // MediaControlElementTypes_h 170 #endif // MediaControlElementTypes_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698