Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/chrome/browser/resources/omnibox/omnibox_output.js b/chrome/browser/resources/omnibox/omnibox_output.js
- index 55038963464a..8f8d4596b40b 100644
- --- a/chrome/browser/resources/omnibox/omnibox_output.js
- +++ b/chrome/browser/resources/omnibox/omnibox_output.js
- @@ -522,37 +522,6 @@ cr.define('omnibox_output', function() {
- }
- }
- - /** Responsible for setting clipboard contents. */
- - class Copier {
- - /**
- - * @param {omnibox_output.OmniboxController} omniboxController
- - * @param {omnibox_output.OmniboxOutput} omniboxOutput
- - */
- - constructor(omniboxController, omniboxOutput) {
- - /** @type {omnibox_output.OmniboxController} */
- - this.omniboxController = omniboxController;
- - /** @type {omnibox_output.OmniboxOutput} */
- - this.omniboxOutput = omniboxOutput;
- - }
- -
- - copyTextOutput() {
- - this.copy_(this.omniboxOutput.visibletableText);
- - }
- -
- - copyJsonOutput() {
- - this.copy_(JSON.stringify(this.omniboxController.responses, null, 2));
- - }
- -
- - /**
- - * @private
- - * @param {string} value
- - */
- - copy_(value) {
- - navigator.clipboard.writeText(value).catch(
- - error => console.log('unable to copy to clipboard:', error));
- - }
- - }
- -
- /**
- * Provides a single public interface to control the output. Currently, this
- * means providing a public interface for OmniboxOutput and Copier. In the
- @@ -576,8 +545,6 @@ cr.define('omnibox_output', function() {
- constructor(omniboxOutput) {
- /** @type {omnibox_output.OmniboxOutput} */
- this.omniboxOutput = omniboxOutput;
- - /** @type {Copier} */
- - this.copier = new Copier(this, omniboxOutput);
- /** @type {!Array<!mojom.OmniboxResult>} */
- this.responses = [];
- @@ -620,12 +587,16 @@ cr.define('omnibox_output', function() {
- // Methods for controlling copier
- +
- copyTextOutput() {
- - this.copier.copyTextOutput();
- + navigator.clipboard.writeText(this.omniboxOutput.visibletableText).catch(
- + error => console.error('unable to copy to clipboard:', error));
- }
- copyJsonOutput() {
- - this.copier.copyJsonOutput();
- + const text = JSON.stringify(this.responses, null, 2);
- + navigator.clipboard.writeText(text).catch(
- + error => console.error('unable to copy to clipboard:', error));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement