| // 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 feed_internals.mojom; |
| |
| // General properties of Feed suggestions. |
| struct Properties { |
| // Whether the Feed is enabled. |
| bool is_feed_enabled; |
| }; |
| |
| struct UserClassifier { |
| // User class description. |
| string user_class_description; |
| |
| // Estimated average length of time between two successive suggestion views of |
| // in hours. |
| float avg_hours_between_views; |
| |
| // Estimated average length of time between two successive uses of suggestions |
| // in hours. |
| float avg_hours_between_uses; |
| }; |
| |
| struct LastFetchProperties { |
| // Last fetch status. |
| int32 last_fetch_status; |
| |
| // Last fetch time. |
| Time? last_fetch_time; |
| |
| // Time until which the scheduler will stop requesting refreshes, unless there |
| // is direct user interaction. |
| Time? refresh_suppress_time; |
| }; |
| |
| // Models a single suggestion in the Feed. |
| struct Suggestion { |
| // Title of the suggestion. |
| string title; |
| |
| // URL of the suggested page. |
| string url; |
| |
| // Name of the content's publisher. |
| string publisher_name; |
| |
| // URL of the image associated with the suggestion. |
| string image_url; |
| |
| // URL of the suggested page's favicon. |
| string favicon_url; |
| }; |
| |
| // Time wrapper to allow for nullable objects. |
| struct Time { |
| double ms_since_epoch; |
| }; |
| |
| // Browser interface for the page. Consists of calls for data and hooks for |
| // interactivity. |
| interface PageHandler { |
| // Get general property values. |
| GetGeneralProperties() => (Properties properties); |
| |
| // Get user classifier property values. |
| GetUserClassifierProperties() => (UserClassifier properties); |
| |
| // Clear stored properties for the user classifier. |
| ClearUserClassifierProperties(); |
| |
| // Get last fetch data. |
| GetLastFetchProperties() => (LastFetchProperties properties); |
| |
| // Clear all data cached by the Feed library. Also triggers a refresh of the |
| // Feed. |
| ClearCachedDataAndRefreshFeed(); |
| |
| // Get the last known content with metadata. |
| GetCurrentContent() => (array<Suggestion> suggestions); |
| }; |