| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 this.pendingDeleteItems_ = items; | 37 this.pendingDeleteItems_ = items; |
| 38 this.pendingDeletePromise_ = new PromiseResolver(); | 38 this.pendingDeletePromise_ = new PromiseResolver(); |
| 39 | 39 |
| 40 chrome.send('removeVisits', removalList); | 40 chrome.send('removeVisits', removalList); |
| 41 | 41 |
| 42 return this.pendingDeletePromise_.promise; | 42 return this.pendingDeletePromise_.promise; |
| 43 }, | 43 }, |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * @param {!string} url |
| 47 */ |
| 48 removeBookmark: function(url) { |
| 49 chrome.send('removeBookmark', [url]); |
| 50 }, |
| 51 |
| 52 /** |
| 46 * @param {boolean} successful | 53 * @param {boolean} successful |
| 47 * @private | 54 * @private |
| 48 */ | 55 */ |
| 49 resolveDelete_: function(successful) { | 56 resolveDelete_: function(successful) { |
| 50 if (this.pendingDeleteItems_ == null || | 57 if (this.pendingDeleteItems_ == null || |
| 51 this.pendingDeletePromise_ == null) { | 58 this.pendingDeletePromise_ == null) { |
| 52 return; | 59 return; |
| 53 } | 60 } |
| 54 | 61 |
| 55 if (successful) | 62 if (successful) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 74 md_history.BrowserService.getInstance().resolveDelete_(true); | 81 md_history.BrowserService.getInstance().resolveDelete_(true); |
| 75 } | 82 } |
| 76 | 83 |
| 77 /** | 84 /** |
| 78 * Called by the history backend when the deletion failed. | 85 * Called by the history backend when the deletion failed. |
| 79 */ | 86 */ |
| 80 function deleteFailed() { | 87 function deleteFailed() { |
| 81 md_history.BrowserService.getInstance().resolveDelete_(false); | 88 md_history.BrowserService.getInstance().resolveDelete_(false); |
| 82 } | 89 } |
| 83 | 90 |
| OLD | NEW |