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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 * @param {string} histogram | 84 * @param {string} histogram |
85 * @param {number} value | 85 * @param {number} value |
86 * @param {number} max | 86 * @param {number} max |
87 */ | 87 */ |
88 recordHistogram: function(histogram, value, max) { | 88 recordHistogram: function(histogram, value, max) { |
89 chrome.send('metricsHandler:recordInHistogram', [histogram, value, max]); | 89 chrome.send('metricsHandler:recordInHistogram', [histogram, value, max]); |
90 }, | 90 }, |
91 | 91 |
92 /** | 92 /** |
93 * Record an action in UMA. | 93 * Record an action in UMA. |
94 * @param {string} actionDesc The name of the action to be logged. | 94 * @param {string} action The name of the action to be logged. |
95 */ | 95 */ |
96 recordAction: function(actionDesc) { | 96 recordAction: function(action) { |
97 chrome.send('metricsHandler:recordAction', [actionDesc]); | 97 if (action.indexOf('_') == -1) |
| 98 action = 'HistoryPage_' + action; |
| 99 chrome.send('metricsHandler:recordAction', [action]); |
98 }, | 100 }, |
99 | 101 |
100 /** | 102 /** |
101 * @param {boolean} successful | 103 * @param {boolean} successful |
102 * @private | 104 * @private |
103 */ | 105 */ |
104 resolveDelete_: function(successful) { | 106 resolveDelete_: function(successful) { |
105 if (this.pendingDeleteItems_ == null || | 107 if (this.pendingDeleteItems_ == null || |
106 this.pendingDeletePromise_ == null) { | 108 this.pendingDeletePromise_ == null) { |
107 return; | 109 return; |
(...skipping 21 matching lines...) Expand all Loading... |
129 md_history.BrowserService.getInstance().resolveDelete_(true); | 131 md_history.BrowserService.getInstance().resolveDelete_(true); |
130 } | 132 } |
131 | 133 |
132 /** | 134 /** |
133 * Called by the history backend when the deletion failed. | 135 * Called by the history backend when the deletion failed. |
134 */ | 136 */ |
135 function deleteFailed() { | 137 function deleteFailed() { |
136 md_history.BrowserService.getInstance().resolveDelete_(false); | 138 md_history.BrowserService.getInstance().resolveDelete_(false); |
137 } | 139 } |
138 | 140 |
OLD | NEW |