| 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 '.tile-grid': 200, | 192 '.tile-grid': 200, |
| 192 '.tile-grid-content': 200, | 193 '.tile-grid-content': 200, |
| 193 '.tile-row': 200, | 194 '.tile-row': 200, |
| 194 '.animate-tile .tile-cell': 200, | 195 '.animate-tile .tile-cell': 200 |
| 195 '.debug .animate-tile .tile-cell': 200 | |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 function adjustAnimationSpeed(slownessFactor) { | 198 function adjustAnimationSpeed(slownessFactor) { |
| 199 slownessFactor = slownessFactor || 1; | 199 slownessFactor = slownessFactor || 1; |
| 200 | 200 |
| 201 var animationRules = []; | 201 var animationRules = []; |
| 202 for (var selector in animationSelectorSpeedMap) { | 202 for (var selector in animationSelectorSpeedMap) { |
| 203 if (animationSelectorSpeedMap.hasOwnProperty(selector)) { | 203 if (animationSelectorSpeedMap.hasOwnProperty(selector)) { |
| 204 animationRules.push(selector + ' { -webkit-transition-duration: ' + | 204 animationRules.push(selector + ' { -webkit-transition-duration: ' + |
| 205 Math.round(animationSelectorSpeedMap[selector] * slownessFactor) + | 205 Math.round(animationSelectorSpeedMap[selector] * slownessFactor) + |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 //---------------------------------------------------------------------------- | 248 //---------------------------------------------------------------------------- |
| 249 // ChromeMock initialization | 249 // ChromeMock initialization |
| 250 //---------------------------------------------------------------------------- | 250 //---------------------------------------------------------------------------- |
| 251 | 251 |
| 252 if (shouldRegisterData) { | 252 if (shouldRegisterData) { |
| 253 interceptLoadData(); | 253 interceptLoadData(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 window.chrome = ChromeMock; | 256 window.chrome = ChromeMock; |
| 257 })(); | 257 })(); |
| OLD | NEW |