commit | 4221a1aa1385e03f0bd89a795ea66f8449c65bb4 | [log] [tgz] |
---|---|---|
author | Tim van der Lippe <[email protected]> | Tue Nov 05 12:54:17 2019 |
committer | Commit Bot <[email protected]> | Tue Nov 05 12:54:30 2019 |
tree | ac750478ecfe202e3fbbd0ab5829a72ed5072152 | |
parent | 59c917ef31b3926db8dc17c6819282aa9dc14cd5 [diff] [blame] |
Revert "Remove unused Main functions" This reverts commit 2d156ac2a51deeb64a84a0afe71d2e27a7b1e4f3. Reason for revert: ReloadActionDelegate is actually used https://cs.chromium.org/chromium/src/third_party/devtools-frontend/src/front_end/main/module.json?l=85&rcl=2cf0518ef4462b1f51dc447f7797f8191c4a365f Original change's description: > Remove unused Main functions > > sendOverProtocol: > https://cs.chromium.org/search/?q=sendOverProtocol&sq=package:chromium&type=cs > > ReloadActionDelegate: > https://cs.chromium.org/search/?q=ReloadActionDelegate&sq=package:chromium&type=cs > Change-Id: Ib731666c239d0c1b7d38e4ac3ef575486ddba549 > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897681 > Commit-Queue: Tim van der Lippe <[email protected]> > Commit-Queue: Yang Guo <[email protected]> > Auto-Submit: Tim van der Lippe <[email protected]> > Reviewed-by: Yang Guo <[email protected]> [email protected],[email protected] Change-Id: I608a106d48d11f0ea196b4c069882d33006ea7c2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1899512 Reviewed-by: Tim van der Lippe <[email protected]> Commit-Queue: Tim van der Lippe <[email protected]>
diff --git a/front_end/main/Main.js b/front_end/main/Main.js index f6d3c57..1ab288d 100644 --- a/front_end/main/Main.js +++ b/front_end/main/Main.js
@@ -683,4 +683,41 @@ } }; +/** + * @param {string} method + * @param {?Object} params + * @return {!Promise} + */ +Main.sendOverProtocol = function(method, params) { + return new Promise((resolve, reject) => { + Protocol.test.sendRawMessage(method, params, (err, ...results) => { + if (err) { + return reject(err); + } + return resolve(results); + }); + }); +}; + +/** + * @implements {UI.ActionDelegate} + * @unrestricted + */ +Main.ReloadActionDelegate = class { + /** + * @override + * @param {!UI.Context} context + * @param {string} actionId + * @return {boolean} + */ + handleAction(context, actionId) { + switch (actionId) { + case 'main.debug-reload': + Components.reload(); + return true; + } + return false; + } +}; + new Main.Main();