| 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 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Repository which stores information about the user. Events are dispatched | 9 * Repository which stores information about the user. Events are dispatched |
| 10 * when the information changes. | 10 * when the information changes. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 this.tracker_.removeAll(); | 65 this.tracker_.removeAll(); |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Called when a Google Cloud Print printer search completes. Updates user | 69 * Called when a Google Cloud Print printer search completes. Updates user |
| 70 * information. | 70 * information. |
| 71 * @type {cr.Event} event Contains information about the logged in user. | 71 * @type {cr.Event} event Contains information about the logged in user. |
| 72 * @private | 72 * @private |
| 73 */ | 73 */ |
| 74 onCloudPrintSearchDone_: function(event) { | 74 onCloudPrintSearchDone_: function(event) { |
| 75 this.userEmail_ = event.email; | 75 if (event.origin == print_preview.Destination.Origin.COOKIES) { |
| 76 cr.dispatchSimpleEvent(this, UserInfo.EventType.EMAIL_CHANGE); | 76 this.userEmail_ = event.email; |
| 77 cr.dispatchSimpleEvent(this, UserInfo.EventType.EMAIL_CHANGE); |
| 78 } |
| 77 } | 79 } |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 return { | 82 return { |
| 81 UserInfo: UserInfo | 83 UserInfo: UserInfo |
| 82 }; | 84 }; |
| 83 }); | 85 }); |
| OLD | NEW |