| 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.browser_options', function() { | 5 cr.define('options.browser_options', function() { |
| 6 /** @const */ var AutocompleteList = cr.ui.AutocompleteList; | 6 /** @const */ var AutocompleteList = cr.ui.AutocompleteList; |
| 7 /** @const */ var InlineEditableItem = options.InlineEditableItem; | 7 /** @const */ var InlineEditableItem = options.InlineEditableItem; |
| 8 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; | 8 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 urlField_: null, | 40 urlField_: null, |
| 41 | 41 |
| 42 /** @inheritDoc */ | 42 /** @inheritDoc */ |
| 43 decorate: function() { | 43 decorate: function() { |
| 44 InlineEditableItem.prototype.decorate.call(this); | 44 InlineEditableItem.prototype.decorate.call(this); |
| 45 | 45 |
| 46 var pageInfo = this.pageInfo_; | 46 var pageInfo = this.pageInfo_; |
| 47 | 47 |
| 48 if (pageInfo['modelIndex'] == '-1') { | 48 if (pageInfo['modelIndex'] == '-1') { |
| 49 this.isPlaceholder = true; | 49 this.isPlaceholder = true; |
| 50 pageInfo['title'] = localStrings.getString('startupAddLabel'); | 50 pageInfo['title'] = loadTimeData.getString('startupAddLabel'); |
| 51 pageInfo['url'] = ''; | 51 pageInfo['url'] = ''; |
| 52 } | 52 } |
| 53 | 53 |
| 54 var titleEl = this.ownerDocument.createElement('div'); | 54 var titleEl = this.ownerDocument.createElement('div'); |
| 55 titleEl.className = 'title'; | 55 titleEl.className = 'title'; |
| 56 titleEl.classList.add('favicon-cell'); | 56 titleEl.classList.add('favicon-cell'); |
| 57 titleEl.classList.add('weakrtl'); | 57 titleEl.classList.add('weakrtl'); |
| 58 titleEl.textContent = pageInfo['title']; | 58 titleEl.textContent = pageInfo['title']; |
| 59 if (!this.isPlaceholder) { | 59 if (!this.isPlaceholder) { |
| 60 titleEl.style.backgroundImage = url('chrome://favicon/' + | 60 titleEl.style.backgroundImage = url('chrome://favicon/' + |
| 61 pageInfo['url']); | 61 pageInfo['url']); |
| 62 titleEl.title = pageInfo['tooltip']; | 62 titleEl.title = pageInfo['tooltip']; |
| 63 } | 63 } |
| 64 | 64 |
| 65 this.contentElement.appendChild(titleEl); | 65 this.contentElement.appendChild(titleEl); |
| 66 | 66 |
| 67 var urlEl = this.createEditableTextCell(pageInfo['url']); | 67 var urlEl = this.createEditableTextCell(pageInfo['url']); |
| 68 urlEl.className = 'url'; | 68 urlEl.className = 'url'; |
| 69 urlEl.classList.add('weakrtl'); | 69 urlEl.classList.add('weakrtl'); |
| 70 this.contentElement.appendChild(urlEl); | 70 this.contentElement.appendChild(urlEl); |
| 71 | 71 |
| 72 var urlField = urlEl.querySelector('input'); | 72 var urlField = urlEl.querySelector('input'); |
| 73 urlField.className = 'weakrtl'; | 73 urlField.className = 'weakrtl'; |
| 74 urlField.placeholder = localStrings.getString('startupPagesPlaceholder'); | 74 urlField.placeholder = loadTimeData.getString('startupPagesPlaceholder'); |
| 75 this.urlField_ = urlField; | 75 this.urlField_ = urlField; |
| 76 | 76 |
| 77 this.addEventListener('commitedit', this.onEditCommitted_); | 77 this.addEventListener('commitedit', this.onEditCommitted_); |
| 78 | 78 |
| 79 var self = this; | 79 var self = this; |
| 80 urlField.addEventListener('focus', function(event) { | 80 urlField.addEventListener('focus', function(event) { |
| 81 self.parentNode.autocompleteList.attachToInput(urlField); | 81 self.parentNode.autocompleteList.attachToInput(urlField); |
| 82 }); | 82 }); |
| 83 urlField.addEventListener('blur', function(event) { | 83 urlField.addEventListener('blur', function(event) { |
| 84 self.parentNode.autocompleteList.detach(); | 84 self.parentNode.autocompleteList.detach(); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 this.hideDropMarkerTimer_ = window.setTimeout(function() { | 301 this.hideDropMarkerTimer_ = window.setTimeout(function() { |
| 302 $('startupPagesListDropmarker').style.display = ''; | 302 $('startupPagesListDropmarker').style.display = ''; |
| 303 }, 100); | 303 }, 100); |
| 304 }, | 304 }, |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 return { | 307 return { |
| 308 StartupPageList: StartupPageList | 308 StartupPageList: StartupPageList |
| 309 }; | 309 }; |
| 310 }); | 310 }); |
| OLD | NEW |