Chromium Code Reviews| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 */ | 74 */ |
| 75 deleteForeignSession: function(sessionTag) { | 75 deleteForeignSession: function(sessionTag) { |
| 76 chrome.send('deleteForeignSession', [sessionTag]); | 76 chrome.send('deleteForeignSession', [sessionTag]); |
| 77 }, | 77 }, |
| 78 | 78 |
| 79 openClearBrowsingData: function() { | 79 openClearBrowsingData: function() { |
| 80 chrome.send('clearBrowsingData'); | 80 chrome.send('clearBrowsingData'); |
| 81 }, | 81 }, |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * @param {Array} args | |
| 85 */ | |
| 86 recordAction: function(args) { | |
| 87 chrome.send('metricsHandler:recordAction', args); | |
|
tsergeant
2016/08/15 07:05:17
Replace args with a single argument for the action
calamity
2016/08/17 03:15:28
Done.
| |
| 88 }, | |
| 89 | |
| 90 /** | |
| 91 * @param {Array} args | |
| 92 */ | |
| 93 recordHistogram: function(args) { | |
| 94 chrome.send('metricsHandler:recordInHistogram', args); | |
|
tsergeant
2016/08/15 07:05:17
As above, use specific arguments here rather than
calamity
2016/08/17 03:15:29
Done.
| |
| 95 }, | |
| 96 | |
| 97 /** | |
| 84 * @param {boolean} successful | 98 * @param {boolean} successful |
| 85 * @private | 99 * @private |
| 86 */ | 100 */ |
| 87 resolveDelete_: function(successful) { | 101 resolveDelete_: function(successful) { |
| 88 if (this.pendingDeleteItems_ == null || | 102 if (this.pendingDeleteItems_ == null || |
| 89 this.pendingDeletePromise_ == null) { | 103 this.pendingDeletePromise_ == null) { |
| 90 return; | 104 return; |
| 91 } | 105 } |
| 92 | 106 |
| 93 if (successful) | 107 if (successful) |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 112 md_history.BrowserService.getInstance().resolveDelete_(true); | 126 md_history.BrowserService.getInstance().resolveDelete_(true); |
| 113 } | 127 } |
| 114 | 128 |
| 115 /** | 129 /** |
| 116 * Called by the history backend when the deletion failed. | 130 * Called by the history backend when the deletion failed. |
| 117 */ | 131 */ |
| 118 function deleteFailed() { | 132 function deleteFailed() { |
| 119 md_history.BrowserService.getInstance().resolveDelete_(false); | 133 md_history.BrowserService.getInstance().resolveDelete_(false); |
| 120 } | 134 } |
| 121 | 135 |
| OLD | NEW |