OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 function assert(condition, opt_message) { | 4 function assert(condition, opt_message) { |
5 if (!condition) { | 5 if (!condition) { |
6 var message = 'Assertion failed'; | 6 var message = 'Assertion failed'; |
7 if (opt_message) message = message + ': ' + opt_message; | 7 if (opt_message) message = message + ': ' + opt_message; |
8 var error = new Error(message); | 8 var error = new Error(message); |
9 var global = function() { | 9 var global = function() { |
10 return this; | 10 return this; |
(...skipping 6744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6755 // Copyright 2016 The Chromium Authors. All rights reserved. | 6755 // Copyright 2016 The Chromium Authors. All rights reserved. |
6756 // Use of this source code is governed by a BSD-style license that can be | 6756 // Use of this source code is governed by a BSD-style license that can be |
6757 // found in the LICENSE file. | 6757 // found in the LICENSE file. |
6758 Polymer({ | 6758 Polymer({ |
6759 is: 'cr-toolbar', | 6759 is: 'cr-toolbar', |
6760 properties: { | 6760 properties: { |
6761 pageName: String, | 6761 pageName: String, |
6762 searchPrompt: String, | 6762 searchPrompt: String, |
6763 clearLabel: String, | 6763 clearLabel: String, |
6764 menuLabel: String, | 6764 menuLabel: String, |
| 6765 menuPromo: String, |
6765 spinnerActive: Boolean, | 6766 spinnerActive: Boolean, |
6766 showMenu: { | 6767 showMenu: { |
6767 type: Boolean, | 6768 type: Boolean, |
6768 value: false | 6769 value: false |
6769 }, | 6770 }, |
| 6771 showMenuPromo: { |
| 6772 type: Boolean, |
| 6773 value: false |
| 6774 }, |
| 6775 closeMenuPromo: String, |
6770 narrow_: { | 6776 narrow_: { |
6771 type: Boolean, | 6777 type: Boolean, |
6772 reflectToAttribute: true | 6778 reflectToAttribute: true |
6773 }, | 6779 }, |
6774 showingSearch_: { | 6780 showingSearch_: { |
6775 type: Boolean, | 6781 type: Boolean, |
6776 reflectToAttribute: true | 6782 reflectToAttribute: true |
6777 } | 6783 } |
6778 }, | 6784 }, |
| 6785 observers: [ 'possiblyShowMenuPromo_(showMenu, showMenuPromo, showingSearch_)'
], |
6779 getSearchField: function() { | 6786 getSearchField: function() { |
6780 return this.$.search; | 6787 return this.$.search; |
6781 }, | 6788 }, |
6782 onMenuTap_: function(e) { | 6789 onClosePromoTap_: function() { |
| 6790 this.showMenuPromo = false; |
| 6791 }, |
| 6792 onMenuTap_: function() { |
6783 this.fire('cr-menu-tap'); | 6793 this.fire('cr-menu-tap'); |
| 6794 this.onClosePromoTap_(); |
| 6795 }, |
| 6796 possiblyShowMenuPromo_: function() { |
| 6797 Polymer.RenderStatus.afterNextRender(this, function() { |
| 6798 if (this.showMenu && this.showMenuPromo && !this.showingSearch_) { |
| 6799 this.$$('#menuPromo').animate({ |
| 6800 opacity: [ 0, .9 ] |
| 6801 }, { |
| 6802 duration: 500, |
| 6803 fill: 'forwards' |
| 6804 }); |
| 6805 } |
| 6806 }.bind(this)); |
| 6807 }, |
| 6808 titleIfNotShowMenuPromo_: function(title, showMenuPromo) { |
| 6809 return showMenuPromo ? '' : title; |
6784 } | 6810 } |
6785 }); | 6811 }); |
6786 | 6812 |
6787 // Copyright 2015 The Chromium Authors. All rights reserved. | 6813 // Copyright 2015 The Chromium Authors. All rights reserved. |
6788 // Use of this source code is governed by a BSD-style license that can be | 6814 // Use of this source code is governed by a BSD-style license that can be |
6789 // found in the LICENSE file. | 6815 // found in the LICENSE file. |
6790 cr.define('downloads', function() { | 6816 cr.define('downloads', function() { |
6791 var Toolbar = Polymer({ | 6817 var Toolbar = Polymer({ |
6792 is: 'downloads-toolbar', | 6818 is: 'downloads-toolbar', |
6793 properties: { | 6819 properties: { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6984 }; | 7010 }; |
6985 return { | 7011 return { |
6986 Manager: Manager | 7012 Manager: Manager |
6987 }; | 7013 }; |
6988 }); | 7014 }); |
6989 | 7015 |
6990 // Copyright 2015 The Chromium Authors. All rights reserved. | 7016 // Copyright 2015 The Chromium Authors. All rights reserved. |
6991 // Use of this source code is governed by a BSD-style license that can be | 7017 // Use of this source code is governed by a BSD-style license that can be |
6992 // found in the LICENSE file. | 7018 // found in the LICENSE file. |
6993 window.addEventListener('load', downloads.Manager.onLoad); | 7019 window.addEventListener('load', downloads.Manager.onLoad); |
OLD | NEW |