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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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 | Annotate | Revision Log
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (displayType == m_displayType) 95 if (displayType == m_displayType)
96 return; 96 return;
97 97
98 m_displayType = displayType; 98 m_displayType = displayType;
99 if (RenderObject* object = m_element->renderer()) 99 if (RenderObject* object = m_element->renderer())
100 object->repaint(); 100 object->repaint();
101 } 101 }
102 102
103 // ---------------------------- 103 // ----------------------------
104 104
105 MediaControlDivElement::MediaControlDivElement(Document* document, MediaControlE lementType displayType) 105 MediaControlDivElement::MediaControlDivElement(Document& document, MediaControlE lementType displayType)
106 : HTMLDivElement(divTag, document) 106 : HTMLDivElement(divTag, document)
107 , MediaControlElement(displayType, this) 107 , MediaControlElement(displayType, this)
108 { 108 {
109 } 109 }
110 110
111 // ---------------------------- 111 // ----------------------------
112 112
113 MediaControlInputElement::MediaControlInputElement(Document* document, MediaCont rolElementType displayType) 113 MediaControlInputElement::MediaControlInputElement(Document& document, MediaCont rolElementType displayType)
114 : HTMLInputElement(inputTag, document, 0, false) 114 : HTMLInputElement(inputTag, document, 0, false)
115 , MediaControlElement(displayType, this) 115 , MediaControlElement(displayType, this)
116 { 116 {
117 } 117 }
118 118
119 bool MediaControlInputElement::isMouseFocusable() const 119 bool MediaControlInputElement::isMouseFocusable() const
120 { 120 {
121 return false; 121 return false;
122 } 122 }
123 123
124 // ---------------------------- 124 // ----------------------------
125 125
126 MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(Document* documen t, MediaControlElementType displayType) 126 MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(Document& documen t, MediaControlElementType displayType)
127 : MediaControlDivElement(document, displayType) 127 : MediaControlDivElement(document, displayType)
128 , m_currentValue(0) 128 , m_currentValue(0)
129 { 129 {
130 } 130 }
131 131
132 void MediaControlTimeDisplayElement::setCurrentValue(double time) 132 void MediaControlTimeDisplayElement::setCurrentValue(double time)
133 { 133 {
134 m_currentValue = time; 134 m_currentValue = time;
135 } 135 }
136 136
137 // ---------------------------- 137 // ----------------------------
138 138
139 MediaControlMuteButtonElement::MediaControlMuteButtonElement(Document* document, MediaControlElementType displayType) 139 MediaControlMuteButtonElement::MediaControlMuteButtonElement(Document& document, MediaControlElementType displayType)
140 : MediaControlInputElement(document, displayType) 140 : MediaControlInputElement(document, displayType)
141 { 141 {
142 } 142 }
143 143
144 void MediaControlMuteButtonElement::defaultEventHandler(Event* event) 144 void MediaControlMuteButtonElement::defaultEventHandler(Event* event)
145 { 145 {
146 if (event->type() == eventNames().clickEvent) { 146 if (event->type() == eventNames().clickEvent) {
147 mediaController()->setMuted(!mediaController()->muted()); 147 mediaController()->setMuted(!mediaController()->muted());
148 event->setDefaultHandled(); 148 event->setDefaultHandled();
149 } 149 }
150 150
151 HTMLInputElement::defaultEventHandler(event); 151 HTMLInputElement::defaultEventHandler(event);
152 } 152 }
153 153
154 void MediaControlMuteButtonElement::changedMute() 154 void MediaControlMuteButtonElement::changedMute()
155 { 155 {
156 updateDisplayType(); 156 updateDisplayType();
157 } 157 }
158 158
159 void MediaControlMuteButtonElement::updateDisplayType() 159 void MediaControlMuteButtonElement::updateDisplayType()
160 { 160 {
161 setDisplayType(mediaController()->muted() ? MediaUnMuteButton : MediaMuteBut ton); 161 setDisplayType(mediaController()->muted() ? MediaUnMuteButton : MediaMuteBut ton);
162 } 162 }
163 163
164 // ---------------------------- 164 // ----------------------------
165 165
166 MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(Document* docum ent) 166 MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(Document& docum ent)
167 : MediaControlInputElement(document, MediaVolumeSlider) 167 : MediaControlInputElement(document, MediaVolumeSlider)
168 , m_clearMutedOnUserInteraction(false) 168 , m_clearMutedOnUserInteraction(false)
169 { 169 {
170 } 170 }
171 171
172 void MediaControlVolumeSliderElement::defaultEventHandler(Event* event) 172 void MediaControlVolumeSliderElement::defaultEventHandler(Event* event)
173 { 173 {
174 // Left button is 0. Rejects mouse events not from left button. 174 // Left button is 0. Rejects mouse events not from left button.
175 if (event->isMouseEvent() && toMouseEvent(event)->button()) 175 if (event->isMouseEvent() && toMouseEvent(event)->button())
176 return; 176 return;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 if (value().toDouble() != volume) 211 if (value().toDouble() != volume)
212 setValue(String::number(volume)); 212 setValue(String::number(volume));
213 } 213 }
214 214
215 void MediaControlVolumeSliderElement::setClearMutedOnUserInteraction(bool clearM ute) 215 void MediaControlVolumeSliderElement::setClearMutedOnUserInteraction(bool clearM ute)
216 { 216 {
217 m_clearMutedOnUserInteraction = clearMute; 217 m_clearMutedOnUserInteraction = clearMute;
218 } 218 }
219 219
220 } // namespace WebCore 220 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlElementTypes.h ('k') | Source/core/html/shadow/MediaControlElements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698