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 14 matching lines...) Expand all Loading... | |
25 __proto__: OptionsPage.prototype, | 25 __proto__: OptionsPage.prototype, |
26 | 26 |
27 /** | 27 /** |
28 * The timer id of the timer set on search query change events. | 28 * The timer id of the timer set on search query change events. |
29 * @type {number} | 29 * @type {number} |
30 * @private | 30 * @private |
31 */ | 31 */ |
32 queryDelayTimerId_: 0, | 32 queryDelayTimerId_: 0, |
33 | 33 |
34 /** | 34 /** |
35 * The most recent search query, or null 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_: null, | 39 lastQuery_: '', |
battre
2012/08/08 18:00:59
I did this change, such that this.searchCookie();
| |
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 this.pageDiv.querySelector('.cookies-search-box').addEventListener( |
45 'search', this.handleSearchQueryChange_.bind(this)); | 45 'search', this.handleSearchQueryChange_.bind(this)); |
46 | 46 |
47 this.pageDiv.querySelector('.remove-all-cookies-button').onclick = | 47 this.pageDiv.querySelector('.remove-all-cookies-button').onclick = |
48 function(e) { | 48 function(e) { |
49 chrome.send('removeAllCookies'); | 49 chrome.send('removeAllCookies'); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 * @private | 99 * @private |
100 */ | 100 */ |
101 handleVisibleChange_: function(e) { | 101 handleVisibleChange_: function(e) { |
102 if (!this.visible) | 102 if (!this.visible) |
103 return; | 103 return; |
104 | 104 |
105 // Inform the CookiesViewHandler whether we are operating in regular | 105 // Inform the CookiesViewHandler whether we are operating in regular |
106 // cookies dialog or the apps one. | 106 // cookies dialog or the apps one. |
107 chrome.send('setViewContext', [this.isAppContext()]); | 107 chrome.send('setViewContext', [this.isAppContext()]); |
108 | 108 |
109 chrome.send('reloadCookies'); | |
110 | |
109 if (!this.initialized_) { | 111 if (!this.initialized_) { |
110 this.initialized_ = true; | 112 this.initialized_ = true; |
111 this.searchCookie(); | 113 this.searchCookie(); |
112 } else { | 114 } else { |
113 this.pageDiv.querySelector('.cookies-list').redraw(); | 115 this.pageDiv.querySelector('.cookies-list').redraw(); |
114 } | 116 } |
115 | 117 |
116 this.pageDiv.querySelector('.cookies-search-box').focus(); | 118 this.pageDiv.querySelector('.cookies-search-box').focus(); |
117 }, | 119 }, |
118 | 120 |
(...skipping 14 matching lines...) Expand all Loading... | |
133 CookiesView.loadChildren = function(args) { | 135 CookiesView.loadChildren = function(args) { |
134 $('cookies-list').loadChildren(args[0], args[1]); | 136 $('cookies-list').loadChildren(args[0], args[1]); |
135 }; | 137 }; |
136 | 138 |
137 // Export | 139 // Export |
138 return { | 140 return { |
139 CookiesView: CookiesView | 141 CookiesView: CookiesView |
140 }; | 142 }; |
141 | 143 |
142 }); | 144 }); |
OLD | NEW |