OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** @enum {string} */ | 8 /** @enum {string} */ |
9 var ResolverState = { | 9 var ResolverState = { |
10 INITIAL: 'INITIAL', | 10 INITIAL: 'INITIAL', |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 this.promiseResolver_ = null; | 48 this.promiseResolver_ = null; |
49 } | 49 } |
50 | 50 |
51 /** | 51 /** |
52 * @param {!print_preview.DestinationStore} store | 52 * @param {!print_preview.DestinationStore} store |
53 * @param {!print_preview.Destination} destination | 53 * @param {!print_preview.Destination} destination |
54 * @return {?ProvisionalDestinationResolver} | 54 * @return {?ProvisionalDestinationResolver} |
55 */ | 55 */ |
56 ProvisionalDestinationResolver.create = function(store, destination) { | 56 ProvisionalDestinationResolver.create = function(store, destination) { |
57 if (destination.provisionalType != | 57 if (destination.provisionalType != |
58 print_preview.Destination.ProvisionalType.NEEDS_USB_PERMISSION) { | 58 print_preview.DestinationProvisionalType.NEEDS_USB_PERMISSION) { |
59 return null; | 59 return null; |
60 } | 60 } |
61 return new ProvisionalDestinationResolver(store, destination); | 61 return new ProvisionalDestinationResolver(store, destination); |
62 }; | 62 }; |
63 | 63 |
64 ProvisionalDestinationResolver.prototype = { | 64 ProvisionalDestinationResolver.prototype = { |
65 __proto__: print_preview.Overlay.prototype, | 65 __proto__: print_preview.Overlay.prototype, |
66 | 66 |
67 /** @override */ | 67 /** @override */ |
68 enterDocument: function() { | 68 enterDocument: function() { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 assert(this.promiseResolver_, 'Promise resolver not created.'); | 209 assert(this.promiseResolver_, 'Promise resolver not created.'); |
210 return this.promiseResolver_.promise; | 210 return this.promiseResolver_.promise; |
211 } | 211 } |
212 }; | 212 }; |
213 | 213 |
214 return { | 214 return { |
215 ProvisionalDestinationResolver: ProvisionalDestinationResolver | 215 ProvisionalDestinationResolver: ProvisionalDestinationResolver |
216 }; | 216 }; |
217 }); | 217 }); |
OLD | NEW |