OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 ///////////////////////////////////////////////////////////////////////////// | 7 ///////////////////////////////////////////////////////////////////////////// |
8 // Preferences class: | 8 // Preferences class: |
9 | 9 |
10 /** | 10 /** |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 * @param {number} value New preference value. | 56 * @param {number} value New preference value. |
57 * @param {string} metric User metrics identifier. | 57 * @param {string} metric User metrics identifier. |
58 */ | 58 */ |
59 Preferences.setIntegerPref = function(name, value, metric) { | 59 Preferences.setIntegerPref = function(name, value, metric) { |
60 var arguments = [name, String(value)]; | 60 var arguments = [name, String(value)]; |
61 if (metric != undefined) arguments.push(metric); | 61 if (metric != undefined) arguments.push(metric); |
62 chrome.send('setIntegerPref', arguments); | 62 chrome.send('setIntegerPref', arguments); |
63 }; | 63 }; |
64 | 64 |
65 /** | 65 /** |
66 * Sets value of a real-valued preference. | |
67 * and signals its changed value. | |
68 * @param {string} name Preference name. | |
69 * @param {number} value New preference value. | |
70 * @param {string} metric User metrics identifier. | |
71 */ | |
72 Preferences.setRealPref = function(name, value, metric) { | |
73 var arguments = [name, String(value)]; | |
arv (Not doing code reviews)
2011/01/13 20:51:10
rename arguments (not forwards compatible with str
| |
74 if (metric != undefined) arguments.push(metric); | |
75 chrome.send('setRealPref', arguments); | |
76 }; | |
77 | |
78 /** | |
66 * Sets value of a string preference. | 79 * Sets value of a string preference. |
67 * and signals its changed value. | 80 * and signals its changed value. |
68 * @param {string} name Preference name. | 81 * @param {string} name Preference name. |
69 * @param {string} value New preference value. | 82 * @param {string} value New preference value. |
70 * @param {string} metric User metrics identifier. | 83 * @param {string} metric User metrics identifier. |
71 */ | 84 */ |
72 Preferences.setStringPref = function(name, value, metric) { | 85 Preferences.setStringPref = function(name, value, metric) { |
73 var arguments = [name, value]; | 86 var arguments = [name, value]; |
74 if (metric != undefined) arguments.push(metric); | 87 if (metric != undefined) arguments.push(metric); |
75 chrome.send('setStringPref', arguments); | 88 chrome.send('setStringPref', arguments); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 Preferences.getInstance().dispatchEvent(event); | 184 Preferences.getInstance().dispatchEvent(event); |
172 }; | 185 }; |
173 | 186 |
174 // Export | 187 // Export |
175 return { | 188 return { |
176 Preferences: Preferences | 189 Preferences: Preferences |
177 }; | 190 }; |
178 | 191 |
179 }); | 192 }); |
180 | 193 |
OLD | NEW |