| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 return this.pendingDeletePromise_.promise; | 42 return this.pendingDeletePromise_.promise; |
| 43 }, | 43 }, |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * @param {!string} url | 46 * @param {!string} url |
| 47 */ | 47 */ |
| 48 removeBookmark: function(url) { | 48 removeBookmark: function(url) { |
| 49 chrome.send('removeBookmark', [url]); | 49 chrome.send('removeBookmark', [url]); |
| 50 }, | 50 }, |
| 51 | 51 |
| 52 openClearBrowsingData: function() { |
| 53 chrome.send('clearBrowsingData'); |
| 54 }, |
| 55 |
| 52 /** | 56 /** |
| 53 * @param {boolean} successful | 57 * @param {boolean} successful |
| 54 * @private | 58 * @private |
| 55 */ | 59 */ |
| 56 resolveDelete_: function(successful) { | 60 resolveDelete_: function(successful) { |
| 57 if (this.pendingDeleteItems_ == null || | 61 if (this.pendingDeleteItems_ == null || |
| 58 this.pendingDeletePromise_ == null) { | 62 this.pendingDeletePromise_ == null) { |
| 59 return; | 63 return; |
| 60 } | 64 } |
| 61 | 65 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 81 md_history.BrowserService.getInstance().resolveDelete_(true); | 85 md_history.BrowserService.getInstance().resolveDelete_(true); |
| 82 } | 86 } |
| 83 | 87 |
| 84 /** | 88 /** |
| 85 * Called by the history backend when the deletion failed. | 89 * Called by the history backend when the deletion failed. |
| 86 */ | 90 */ |
| 87 function deleteFailed() { | 91 function deleteFailed() { |
| 88 md_history.BrowserService.getInstance().resolveDelete_(false); | 92 md_history.BrowserService.getInstance().resolveDelete_(false); |
| 89 } | 93 } |
| 90 | 94 |
| OLD | NEW |