| 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 // TODO(pedrosimonetti): document how to generate the data pseudo-automatically. | 5 // TODO(pedrosimonetti): document how to generate the data pseudo-automatically. |
| 6 !/^chrome:\/\/./.test(location.href) && (function() { | 6 !/^chrome:\/\/./.test(location.href) && (function() { |
| 7 | 7 |
| 8 var __chrome__ = chrome; | 8 var __chrome__ = chrome; |
| 9 var shouldRegisterData = !!window.chrome && !!window.chrome.send; | 9 var shouldRegisterData = !!window.chrome && !!window.chrome.send; |
| 10 | 10 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 }, | 180 }, |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 //---------------------------------------------------------------------------- | 183 //---------------------------------------------------------------------------- |
| 184 // Debug | 184 // Debug |
| 185 //---------------------------------------------------------------------------- | 185 //---------------------------------------------------------------------------- |
| 186 | 186 |
| 187 var debugArgs = {}; | 187 var debugArgs = {}; |
| 188 var debugStylesheet = null; | 188 var debugStylesheet = null; |
| 189 var animationSelectorSpeedMap = { | 189 var animationSelectorSpeedMap = { |
| 190 '#card-slider-frame': 250, |
| 190 '#page-list': 200, | 191 '#page-list': 200, |
| 191 '.dot': 200, | 192 '.dot': 200, |
| 192 '.tile-grid': 200, | 193 '.tile-grid': 200, |
| 193 '.tile-grid-content': 200, | 194 '.tile-grid-content': 200, |
| 194 '.tile-row': 200, | 195 '.tile-row': 200, |
| 195 '.animate-tile .tile-cell': 200, | 196 '.animate-tile .tile-cell': 200 |
| 196 '.debug .animate-tile .tile-cell': 200 | |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 function adjustAnimationSpeed(slownessFactor) { | 199 function adjustAnimationSpeed(slownessFactor) { |
| 200 slownessFactor = slownessFactor || 1; | 200 slownessFactor = slownessFactor || 1; |
| 201 | 201 |
| 202 var animationRules = []; | 202 var animationRules = []; |
| 203 for (var selector in animationSelectorSpeedMap) { | 203 for (var selector in animationSelectorSpeedMap) { |
| 204 if (animationSelectorSpeedMap.hasOwnProperty(selector)) { | 204 if (animationSelectorSpeedMap.hasOwnProperty(selector)) { |
| 205 animationRules.push(selector + ' { -webkit-transition-duration: ' + | 205 animationRules.push(selector + ' { -webkit-transition-duration: ' + |
| 206 Math.round(animationSelectorSpeedMap[selector] * slownessFactor) + | 206 Math.round(animationSelectorSpeedMap[selector] * slownessFactor) + |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 //---------------------------------------------------------------------------- | 249 //---------------------------------------------------------------------------- |
| 250 // ChromeMock initialization | 250 // ChromeMock initialization |
| 251 //---------------------------------------------------------------------------- | 251 //---------------------------------------------------------------------------- |
| 252 | 252 |
| 253 if (shouldRegisterData) { | 253 if (shouldRegisterData) { |
| 254 interceptLoadData(); | 254 interceptLoadData(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 window.chrome = ChromeMock; | 257 window.chrome = ChromeMock; |
| 258 })(); | 258 })(); |
| OLD | NEW |