OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * ButterBar class that is used to show the butter bar with various | 7 * ButterBar class that is used to show the butter bar with various |
8 * notifications. | 8 * notifications. |
9 */ | 9 */ |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 * @param {string} storageKey | 44 * @param {string} storageKey |
45 * @private | 45 * @private |
46 */ | 46 */ |
47 remoting.ButterBar.prototype.show_ = | 47 remoting.ButterBar.prototype.show_ = |
48 function(messageId, substitutions, storageKey) { | 48 function(messageId, substitutions, storageKey) { |
49 this.storageKey_ = storageKey; | 49 this.storageKey_ = storageKey; |
50 | 50 |
51 var messageElement = document.getElementById(remoting.ButterBar.kMessageId_); | 51 var messageElement = document.getElementById(remoting.ButterBar.kMessageId_); |
52 l10n.localizeElementFromTag(messageElement, messageId, substitutions, true); | 52 l10n.localizeElementFromTag(messageElement, messageId, substitutions, true); |
53 var acceptLink = | 53 var acceptLink = |
54 /** @type{Element} */ messageElement.getElementsByTagName('a')[0]; | 54 /** @type{Element} */ (messageElement.getElementsByTagName('a')[0]); |
55 acceptLink.addEventListener( | 55 acceptLink.addEventListener( |
56 'click', this.dismiss.bind(this, true), false); | 56 'click', this.dismiss.bind(this, true), false); |
57 | 57 |
58 document.getElementById(remoting.ButterBar.kDismissId_).addEventListener( | 58 document.getElementById(remoting.ButterBar.kDismissId_).addEventListener( |
59 'click', this.dismiss.bind(this, false), false); | 59 'click', this.dismiss.bind(this, false), false); |
60 | 60 |
61 document.getElementById(remoting.ButterBar.kId_).hidden = false; | 61 document.getElementById(remoting.ButterBar.kId_).hidden = false; |
62 } | 62 } |
63 | 63 |
64 /** | 64 /** |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 var value = {}; | 127 var value = {}; |
128 value[this.storageKey_] = { | 128 value[this.storageKey_] = { |
129 optIn: accepted, | 129 optIn: accepted, |
130 date: new Date(), | 130 date: new Date(), |
131 version: chrome.runtime.getManifest().version | 131 version: chrome.runtime.getManifest().version |
132 }; | 132 }; |
133 chrome.storage.sync.set(value); | 133 chrome.storage.sync.set(value); |
134 | 134 |
135 document.getElementById(remoting.ButterBar.kId_).hidden = true; | 135 document.getElementById(remoting.ButterBar.kId_).hidden = true; |
136 }; | 136 }; |
OLD | NEW |