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 /** | |
53 * @param {string} sessionTag | |
54 */ | |
55 openForeignSessionAllTabs: function(sessionTag) { | |
56 chrome.send('openForeignSession', [sessionTag]); | |
57 }, | |
58 | |
59 /** | |
60 * @param {string} sessionTag | |
61 * @param {number} tabId | |
tsergeant
2016/07/22 03:21:16
Reorder these so they're the same order as the met
calamity
2016/07/27 05:22:06
Done.
| |
62 * @param {number} windowId | |
63 * @param {Event} e | |
tsergeant
2016/07/22 03:21:16
Change this type to reflect that it's not any old
calamity
2016/07/27 05:22:06
Moved the event extraction up a level as discussed
| |
64 */ | |
65 openForeignSessionTab: function(sessionTag, windowId, tabId, e) { | |
66 var srcEvent = e.detail.sourceEvent; | |
67 chrome.send('openForeignSession', [ | |
68 sessionTag, String(windowId), String(tabId), srcEvent.button || 0, | |
69 srcEvent.altKey, srcEvent.ctrlKey, srcEvent.metaKey, srcEvent.shiftKey | |
70 ]); | |
71 }, | |
72 | |
52 openClearBrowsingData: function() { | 73 openClearBrowsingData: function() { |
53 chrome.send('clearBrowsingData'); | 74 chrome.send('clearBrowsingData'); |
54 }, | 75 }, |
55 | 76 |
56 /** | 77 /** |
57 * @param {boolean} successful | 78 * @param {boolean} successful |
58 * @private | 79 * @private |
59 */ | 80 */ |
60 resolveDelete_: function(successful) { | 81 resolveDelete_: function(successful) { |
61 if (this.pendingDeleteItems_ == null || | 82 if (this.pendingDeleteItems_ == null || |
(...skipping 23 matching lines...) Expand all Loading... | |
85 md_history.BrowserService.getInstance().resolveDelete_(true); | 106 md_history.BrowserService.getInstance().resolveDelete_(true); |
86 } | 107 } |
87 | 108 |
88 /** | 109 /** |
89 * Called by the history backend when the deletion failed. | 110 * Called by the history backend when the deletion failed. |
90 */ | 111 */ |
91 function deleteFailed() { | 112 function deleteFailed() { |
92 md_history.BrowserService.getInstance().resolveDelete_(false); | 113 md_history.BrowserService.getInstance().resolveDelete_(false); |
93 } | 114 } |
94 | 115 |
OLD | NEW |