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('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
10 // CookiesView class: | 10 // CookiesView class: |
(...skipping 23 matching lines...) Expand all Loading... |
34 /** | 34 /** |
35 * The most recent search query, empty string if the query is empty. | 35 * The most recent search query, empty string if the query is empty. |
36 * @type {string} | 36 * @type {string} |
37 * @private | 37 * @private |
38 */ | 38 */ |
39 lastQuery_: '', | 39 lastQuery_: '', |
40 | 40 |
41 initializePage: function() { | 41 initializePage: function() { |
42 OptionsPage.prototype.initializePage.call(this); | 42 OptionsPage.prototype.initializePage.call(this); |
43 | 43 |
44 this.pageDiv.querySelector('.cookies-search-box').addEventListener( | 44 var searchBox = this.pageDiv.querySelector('.cookies-search-box'); |
| 45 searchBox.addEventListener( |
45 'search', this.handleSearchQueryChange_.bind(this)); | 46 'search', this.handleSearchQueryChange_.bind(this)); |
| 47 searchBox.onkeydown = function(e) { |
| 48 // Prevent the overlay from handling this event. |
| 49 if (e.keyIdentifier == 'Enter') |
| 50 e.stopPropagation(); |
| 51 }; |
46 | 52 |
47 this.pageDiv.querySelector('.remove-all-cookies-button').onclick = | 53 this.pageDiv.querySelector('.remove-all-cookies-button').onclick = |
48 function(e) { | 54 function(e) { |
49 chrome.send('removeAllCookies'); | 55 chrome.send('removeAllCookies'); |
50 }; | 56 }; |
51 | 57 |
52 var cookiesList = this.pageDiv.querySelector('.cookies-list'); | 58 var cookiesList = this.pageDiv.querySelector('.cookies-list'); |
53 options.CookiesList.decorate(cookiesList); | 59 options.CookiesList.decorate(cookiesList); |
54 | 60 |
55 this.addEventListener('visibleChange', this.handleVisibleChange_); | 61 this.addEventListener('visibleChange', this.handleVisibleChange_); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 CookiesView.loadChildren = function(args) { | 131 CookiesView.loadChildren = function(args) { |
126 $('cookies-list').loadChildren(args[0], args[1]); | 132 $('cookies-list').loadChildren(args[0], args[1]); |
127 }; | 133 }; |
128 | 134 |
129 // Export | 135 // Export |
130 return { | 136 return { |
131 CookiesView: CookiesView | 137 CookiesView: CookiesView |
132 }; | 138 }; |
133 | 139 |
134 }); | 140 }); |
OLD | NEW |