| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 chrome.send('setIntegerPref', argumentList); | 62 chrome.send('setIntegerPref', argumentList); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * Sets value of a real-valued preference. | 66 * Sets value of a real-valued preference. |
| 67 * and signals its changed value. | 67 * and signals its changed value. |
| 68 * @param {string} name Preference name. | 68 * @param {string} name Preference name. |
| 69 * @param {number} value New preference value. | 69 * @param {number} value New preference value. |
| 70 * @param {string} metric User metrics identifier. | 70 * @param {string} metric User metrics identifier. |
| 71 */ | 71 */ |
| 72 Preferences.setRealPref = function(name, value, metric) { | 72 Preferences.setDoublePref = function(name, value, metric) { |
| 73 var argumentList = [name, String(value)]; | 73 var argumentList = [name, String(value)]; |
| 74 if (metric != undefined) argumentList.push(metric); | 74 if (metric != undefined) argumentList.push(metric); |
| 75 chrome.send('setRealPref', argumentList); | 75 chrome.send('setDoublePref', argumentList); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * Sets value of a string preference. | 79 * Sets value of a string preference. |
| 80 * and signals its changed value. | 80 * and signals its changed value. |
| 81 * @param {string} name Preference name. | 81 * @param {string} name Preference name. |
| 82 * @param {string} value New preference value. | 82 * @param {string} value New preference value. |
| 83 * @param {string} metric User metrics identifier. | 83 * @param {string} metric User metrics identifier. |
| 84 */ | 84 */ |
| 85 Preferences.setStringPref = function(name, value, metric) { | 85 Preferences.setStringPref = function(name, value, metric) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 Preferences.getInstance().dispatchEvent(event); | 184 Preferences.getInstance().dispatchEvent(event); |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 // Export | 187 // Export |
| 188 return { | 188 return { |
| 189 Preferences: Preferences | 189 Preferences: Preferences |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 }); | 192 }); |
| 193 | 193 |
| OLD | NEW |