| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 } | 608 } |
| 609 } | 609 } |
| 610 } | 610 } |
| 611 } | 611 } |
| 612 } | 612 } |
| 613 | 613 |
| 614 /** | 614 /** |
| 615 * @constructor | 615 * @constructor |
| 616 * @extends {WebInspector.ToolbarButton} | 616 * @extends {WebInspector.ToolbarButton} |
| 617 * @param {function(!WebInspector.ContextMenu)} contextMenuHandler | 617 * @param {function(!WebInspector.ContextMenu)} contextMenuHandler |
| 618 * @param {boolean=} useSoftMenu |
| 618 */ | 619 */ |
| 619 WebInspector.ToolbarMenuButton = function(contextMenuHandler) | 620 WebInspector.ToolbarMenuButton = function(contextMenuHandler, useSoftMenu) |
| 620 { | 621 { |
| 621 WebInspector.ToolbarButton.call(this, "", "menu-toolbar-item"); | 622 WebInspector.ToolbarButton.call(this, "", "menu-toolbar-item"); |
| 622 this._contextMenuHandler = contextMenuHandler; | 623 this._contextMenuHandler = contextMenuHandler; |
| 624 this._useSoftMenu = !!useSoftMenu; |
| 623 } | 625 } |
| 624 | 626 |
| 625 WebInspector.ToolbarMenuButton.prototype = { | 627 WebInspector.ToolbarMenuButton.prototype = { |
| 626 /** | 628 /** |
| 627 * @override | 629 * @override |
| 628 * @param {!Event} event | 630 * @param {!Event} event |
| 629 */ | 631 */ |
| 630 _clicked: function(event) | 632 _clicked: function(event) |
| 631 { | 633 { |
| 632 var contextMenu = new WebInspector.ContextMenu(event, | 634 var contextMenu = new WebInspector.ContextMenu(event, |
| 633 false, | 635 this._useSoftMenu, |
| 634 this.element.totalOffsetLeft(), | 636 this.element.totalOffsetLeft(), |
| 635 this.element.totalOffsetTop() + this.element.offsetHeight); | 637 this.element.totalOffsetTop() + this.element.offsetHeight); |
| 636 this._contextMenuHandler(contextMenu); | 638 this._contextMenuHandler(contextMenu); |
| 637 contextMenu.show(); | 639 contextMenu.show(); |
| 638 }, | 640 }, |
| 639 | 641 |
| 640 __proto__: WebInspector.ToolbarButton.prototype | 642 __proto__: WebInspector.ToolbarButton.prototype |
| 641 } | 643 } |
| 642 | 644 |
| 643 /** | 645 /** |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 for (var i = 0; i < items.length; ++i) { | 929 for (var i = 0; i < items.length; ++i) { |
| 928 var item = items[i]; | 930 var item = items[i]; |
| 929 if (item) | 931 if (item) |
| 930 this.appendToolbarItem(item); | 932 this.appendToolbarItem(item); |
| 931 } | 933 } |
| 932 } | 934 } |
| 933 }, | 935 }, |
| 934 | 936 |
| 935 __proto__: WebInspector.Toolbar.prototype | 937 __proto__: WebInspector.Toolbar.prototype |
| 936 } | 938 } |
| OLD | NEW |