chromium/chrome/browser/new_tab_page/modules/file_suggestion/file_suggestion.mojom

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

module file_suggestion.mojom;

import "url/mojom/url.mojom";

// A Google Drive or Microsoft Sharepoint File.
struct File {
  // The ID of the File Item.
  string id;
  // Information on why the File Item was returned.
  string justification_text;
  // The mime type of the File Item.
  string mime_type;
  // The name of the File Item.
  string title;
  // The URL to navigate to the File Item.
  url.mojom.Url item_url;
};

// Browser-side handler for requests from NTP Module UI.
interface FileSuggestionHandler {
  // Fetches document suggestions from ItemSuggest API.
  GetFiles() => (array<File> files);
  // Dismissed module for fixed amount of time.
  DismissModule();
  // Restores the module immediately.
  RestoreModule();
};