// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. module snippets_internals.mojom; struct SuggestionCategory { int64 categoryId; string categoryTitle; string status; array suggestions; array dismissedSuggestions; }; struct SuggestionItem { string suggestionTitle; string suggestionId; string suggestionIdWithinCategory; string url; string faviconUrl; string snippet; string publishDate; string publisherName; float score; }; interface PageHandlerFactory { CreatePageHandler(Page page) => (PageHandler handler); }; // Browser interface. interface PageHandler { // Populate properties about preferences/flags. GetGeneralProperties() => (map properties); // Populate the properties for the user classifier. GetUserClassifierProperties() => (map properties); // Clear stored properties for the user classifier. ClearUserClassifierProperties(); // Get category ranker tuples (abritrary field/values). GetCategoryRankerProperties() => (map properties); // Reload the current suggestions. ReloadSuggestions(); // Get the debug log. GetDebugLog() => (string debugLog); // Clear cached suggestions. ClearCachedSuggestions(); // Get the remote content suggestions. GetRemoteContentSuggestionsProperties() => (map properties); // Fetch suggestions in background after the given delay. FetchSuggestionsInBackground(int64 delaySeconds) => (); // Returns if it's possible to push a dummy suggestion. IsPushingDummySuggestionPossible() => (bool result); // Push dummy suggestion in background after the given delay. PushDummySuggestionInBackground(int64 delaySeconds) => (); // Download the last suggestions in json form. GetLastJson() => (string json); // Reset the notification state. ResetNotificationState(); // Get the suggestions by category. GetSuggestionsByCategory() => (array categories); // Clear the dismissed suggestions. ClearDismissedSuggestions(int64 category); }; // Frontend interface. interface Page { OnSuggestionsChanged(); };