| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 isSuggestBoxVisible: function() | 680 isSuggestBoxVisible: function() |
| 681 { | 681 { |
| 682 return this._suggestBox && this._suggestBox.visible(); | 682 return this._suggestBox && this._suggestBox.visible(); |
| 683 }, | 683 }, |
| 684 | 684 |
| 685 /** | 685 /** |
| 686 * @return {boolean} | 686 * @return {boolean} |
| 687 */ | 687 */ |
| 688 isCaretInsidePrompt: function() | 688 isCaretInsidePrompt: function() |
| 689 { | 689 { |
| 690 return this._element.isInsertionCaretInside(); | 690 var selection = this._element.getComponentSelection(); |
| 691 // @see crbug.com/602541 |
| 692 var selectionRange = selection && selection.rangeCount ? selection.getRa
ngeAt(0) : null; |
| 693 if (!selectionRange || !selection.isCollapsed) |
| 694 return false; |
| 695 return selectionRange.startContainer.isSelfOrDescendant(this._element); |
| 691 }, | 696 }, |
| 692 | 697 |
| 693 /** | 698 /** |
| 694 * @return {boolean} | 699 * @return {boolean} |
| 695 */ | 700 */ |
| 696 isCaretAtEndOfPrompt: function() | 701 isCaretAtEndOfPrompt: function() |
| 697 { | 702 { |
| 698 var selection = this._element.getComponentSelection(); | 703 var selection = this._element.getComponentSelection(); |
| 699 var selectionRange = selection && selection.rangeCount ? selection.getRa
ngeAt(0) : null; | 704 var selectionRange = selection && selection.rangeCount ? selection.getRa
ngeAt(0) : null; |
| 700 if (!selectionRange || !selection.isCollapsed) | 705 if (!selectionRange || !selection.isCollapsed) |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 }, | 1024 }, |
| 1020 | 1025 |
| 1021 /** | 1026 /** |
| 1022 * @return {string|undefined} | 1027 * @return {string|undefined} |
| 1023 */ | 1028 */ |
| 1024 _currentHistoryItem: function() | 1029 _currentHistoryItem: function() |
| 1025 { | 1030 { |
| 1026 return this._data[this._data.length - this._historyOffset]; | 1031 return this._data[this._data.length - this._historyOffset]; |
| 1027 } | 1032 } |
| 1028 }; | 1033 }; |
| OLD | NEW |