1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38

ash / webui / scanner_feedback_ui / mojom / scanner_feedback_ui.mojom [blame]

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module ash.mojom.scanner_feedback_ui;

import "url/mojom/url.mojom";

// Encompasses all fixed additional information to attach to a given feedback
// report. Will be displayed to the user in the feedback form.
struct FeedbackInfo {
  // A human-readible string showing the details of the action performed.
  // Will realistically be <50kB.
  // The contents are derived from a Google-owned server response.
  string action_details;
  // A `chrome-untrusted://scanner-feedback/screenshots/UNGUESSABLETOKEN.png`
  // URL which, when accessed, will display the screenshot.
  // The contents are a (possibly resized) screen capture from Ash.
  url.mojom.Url screenshot_url;
};

// Handles communication from `chrome-untrusted://scanner-feedback` to the
// trusted browser process.
interface PageHandler {
  // Gets the `FeedbackInfo` for this page handler.
  // If no feedback information was attached to this page handler (for example,
  // if `chrome-untrusted://scanner-feedback` was manually opened in the
  // browser) calling this will kill the renderer process by reporting a bad
  // message.
  GetFeedbackInfo() => (FeedbackInfo feedback_info);

  // Requests for the dialog displaying this page to be closed.
  // May not immediately close the dialog or the page handler.
  //
  // If no "close dialog" callback was attached to this page handler, calling
  // this will kill the renderer process by reporting a bad message.
  CloseDialog();
};