OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Sets the width (in pixels) on a DOM node. | 6 * Sets the width (in pixels) on a DOM node. |
7 * @param {!HtmlNode} node The node whose width is being set. | 7 * @param {!HtmlNode} node The node whose width is being set. |
8 * @param {number} widthPx The width in pixels. | 8 * @param {number} widthPx The width in pixels. |
9 */ | 9 */ |
10 function setNodeWidth(node, widthPx) { | 10 function setNodeWidth(node, widthPx) { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 * @param {Function} ctor The constructor function being checked. | 162 * @param {Function} ctor The constructor function being checked. |
163 */ | 163 */ |
164 function assertFirstConstructorCall(ctor) { | 164 function assertFirstConstructorCall(ctor) { |
165 // This is the variable which is set by cr.addSingletonGetter(). | 165 // This is the variable which is set by cr.addSingletonGetter(). |
166 if (ctor.hasCreateFirstInstance_) { | 166 if (ctor.hasCreateFirstInstance_) { |
167 throw Error('The class ' + ctor.name + ' is a singleton, and should ' + | 167 throw Error('The class ' + ctor.name + ' is a singleton, and should ' + |
168 'only be accessed using ' + ctor.name + '.getInstance().'); | 168 'only be accessed using ' + ctor.name + '.getInstance().'); |
169 } | 169 } |
170 ctor.hasCreateFirstInstance_ = true; | 170 ctor.hasCreateFirstInstance_ = true; |
171 } | 171 } |
| 172 |
| 173 function hasTouchScreen() { |
| 174 return 'ontouchstart' in window; |
| 175 } |
OLD | NEW |