| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 * @param {number} tabId | 62 * @param {number} tabId |
| 63 * @param {Event} e | 63 * @param {Event} e |
| 64 */ | 64 */ |
| 65 openForeignSessionTab: function(sessionTag, windowId, tabId, e) { | 65 openForeignSessionTab: function(sessionTag, windowId, tabId, e) { |
| 66 chrome.send('openForeignSession', [ | 66 chrome.send('openForeignSession', [ |
| 67 sessionTag, String(windowId), String(tabId), e.button || 0, e.altKey, | 67 sessionTag, String(windowId), String(tabId), e.button || 0, e.altKey, |
| 68 e.ctrlKey, e.metaKey, e.shiftKey | 68 e.ctrlKey, e.metaKey, e.shiftKey |
| 69 ]); | 69 ]); |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 /** |
| 73 * @param {string} sessionTag |
| 74 */ |
| 75 deleteForeignSession: function(sessionTag) { |
| 76 chrome.send('deleteForeignSession', [sessionTag]); |
| 77 }, |
| 78 |
| 72 openClearBrowsingData: function() { | 79 openClearBrowsingData: function() { |
| 73 chrome.send('clearBrowsingData'); | 80 chrome.send('clearBrowsingData'); |
| 74 }, | 81 }, |
| 75 | 82 |
| 76 /** | 83 /** |
| 77 * @param {boolean} successful | 84 * @param {boolean} successful |
| 78 * @private | 85 * @private |
| 79 */ | 86 */ |
| 80 resolveDelete_: function(successful) { | 87 resolveDelete_: function(successful) { |
| 81 if (this.pendingDeleteItems_ == null || | 88 if (this.pendingDeleteItems_ == null || |
| (...skipping 23 matching lines...) Expand all Loading... |
| 105 md_history.BrowserService.getInstance().resolveDelete_(true); | 112 md_history.BrowserService.getInstance().resolveDelete_(true); |
| 106 } | 113 } |
| 107 | 114 |
| 108 /** | 115 /** |
| 109 * Called by the history backend when the deletion failed. | 116 * Called by the history backend when the deletion failed. |
| 110 */ | 117 */ |
| 111 function deleteFailed() { | 118 function deleteFailed() { |
| 112 md_history.BrowserService.getInstance().resolveDelete_(false); | 119 md_history.BrowserService.getInstance().resolveDelete_(false); |
| 113 } | 120 } |
| 114 | 121 |
| OLD | NEW |