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 22 matching lines...) Expand all Loading... |
33 [remoting.ButterBar.kSurveyStorageKey_, | 33 [remoting.ButterBar.kSurveyStorageKey_, |
34 remoting.ButterBar.kHangoutsStorageKey_], | 34 remoting.ButterBar.kHangoutsStorageKey_], |
35 onSyncDataLoaded); | 35 onSyncDataLoaded); |
36 } | 36 } |
37 | 37 |
38 /** | 38 /** |
39 * Shows butter bar with the specified |message| and updates |storageKey| after | 39 * Shows butter bar with the specified |message| and updates |storageKey| after |
40 * the bar is dismissed. | 40 * the bar is dismissed. |
41 * | 41 * |
42 * @param {string} messageId | 42 * @param {string} messageId |
43 * @param {string} substitutions | 43 * @param {string|Array} substitutions |
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 = |
(...skipping 73 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 |