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

Side by Side Diff: Source/devtools/front_end/emulation/MediaQueryInspector.js

Issue 1204393002: DevTools: [CSS] promisify CSSStyleModel fetching methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * @constructor 6 * @constructor
7 * @extends {WebInspector.Widget} 7 * @extends {WebInspector.Widget}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.MediaQueryInspector = function() 10 WebInspector.MediaQueryInspector = function()
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 /** 178 /**
179 * @param {!WebInspector.Throttler.FinishCallback} finishCallback 179 * @param {!WebInspector.Throttler.FinishCallback} finishCallback
180 */ 180 */
181 _refetchMediaQueries: function(finishCallback) 181 _refetchMediaQueries: function(finishCallback)
182 { 182 {
183 if (!this._enabled || !this._cssModel) { 183 if (!this._enabled || !this._cssModel) {
184 finishCallback(); 184 finishCallback();
185 return; 185 return;
186 } 186 }
187 187
188 /** 188 this._cssModel.mediaQueriesPromise()
189 * @param {!Array.<!WebInspector.CSSMedia>} cssMedias 189 .then(this._rebuildMediaQueries.bind(this))
190 * @this {!WebInspector.MediaQueryInspector} 190 .then(finishCallback)
pfeldman 2015/06/26 09:59:17 then(finishCallback, finishCallback);
lushnikov 2015/06/26 10:16:26 The .catch is way more easy to read and find visua
191 */ 191 .catch(finishCallback);
192 function callback(cssMedias)
193 {
194 this._rebuildMediaQueries(cssMedias);
195 finishCallback();
196 }
197 this._cssModel.getMediaQueries(callback.bind(this));
198 }, 192 },
199 193
200 /** 194 /**
201 * @param {!Array.<!WebInspector.MediaQueryInspector.MediaQueryUIModel>} mod els 195 * @param {!Array.<!WebInspector.MediaQueryInspector.MediaQueryUIModel>} mod els
202 * @return {!Array.<!WebInspector.MediaQueryInspector.MediaQueryUIModel>} 196 * @return {!Array.<!WebInspector.MediaQueryInspector.MediaQueryUIModel>}
203 */ 197 */
204 _squashAdjacentEqual: function(models) 198 _squashAdjacentEqual: function(models)
205 { 199 {
206 var filtered = []; 200 var filtered = [];
207 for (var i = 0; i < models.length; ++i) { 201 for (var i = 0; i < models.length; ++i) {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 }, 501 },
508 502
509 /** 503 /**
510 * @return {boolean} 504 * @return {boolean}
511 */ 505 */
512 active: function() 506 active: function()
513 { 507 {
514 return this._active; 508 return this._active;
515 } 509 }
516 } 510 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/SharedSidebarModel.js ('k') | Source/devtools/front_end/sdk/CSSStyleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698