| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Defines a singleton object, md_history.BrowserService, which | 6 * @fileoverview Defines a singleton object, md_history.BrowserService, which |
| 7 * provides access to chrome.send APIs. | 7 * provides access to chrome.send APIs. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 cr.define('md_history', function() { | 10 cr.define('md_history', function() { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 /** | 85 /** |
| 86 * @param {string} histogram | 86 * @param {string} histogram |
| 87 * @param {number} value | 87 * @param {number} value |
| 88 * @param {number} max | 88 * @param {number} max |
| 89 */ | 89 */ |
| 90 recordHistogram: function(histogram, value, max) { | 90 recordHistogram: function(histogram, value, max) { |
| 91 chrome.send('metricsHandler:recordInHistogram', [histogram, value, max]); | 91 chrome.send('metricsHandler:recordInHistogram', [histogram, value, max]); |
| 92 }, | 92 }, |
| 93 | 93 |
| 94 /** | 94 /** |
| 95 * Record an action in UMA. | 95 * Record an action in UMA. |
| 96 * @param {string} action The name of the action to be logged. | 96 * @param {string} action The name of the action to be logged. |
| 97 */ | 97 */ |
| 98 recordAction: function(action) { | 98 recordAction: function(action) { |
| 99 if (action.indexOf('_') == -1) | 99 if (action.indexOf('_') == -1) |
| 100 action = 'HistoryPage_' + action; | 100 action = 'HistoryPage_' + action; |
| 101 chrome.send('metricsHandler:recordAction', [action]); | 101 chrome.send('metricsHandler:recordAction', [action]); |
| 102 }, | 102 }, |
| 103 | 103 |
| 104 /** | 104 /** |
| 105 * @param {boolean} successful | 105 * @param {boolean} successful |
| 106 * @private | 106 * @private |
| 107 */ | 107 */ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 136 function deleteComplete() { | 136 function deleteComplete() { |
| 137 md_history.BrowserService.getInstance().resolveDelete_(true); | 137 md_history.BrowserService.getInstance().resolveDelete_(true); |
| 138 } | 138 } |
| 139 | 139 |
| 140 /** | 140 /** |
| 141 * Called by the history backend when the deletion failed. | 141 * Called by the history backend when the deletion failed. |
| 142 */ | 142 */ |
| 143 function deleteFailed() { | 143 function deleteFailed() { |
| 144 md_history.BrowserService.getInstance().resolveDelete_(false); | 144 md_history.BrowserService.getInstance().resolveDelete_(false); |
| 145 } | 145 } |
| OLD | NEW |