File: feed_internals.mojom

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (123 lines) | stat: -rw-r--r-- 3,705 bytes parent folder | download | duplicates (9)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module feed_internals.mojom;

import "mojo/public/mojom/base/time.mojom";
import "url/mojom/url.mojom";

// Feed sorting order options.
enum FeedOrder {
  kUnspecified = 0,
  kGrouped,
  kReverseChron
};

// General properties of Feed suggestions.
struct Properties {
  // Whether the Feed feature flag is enabled.
  bool is_feed_enabled;

  // Whether suggested articles section is expanded.
  bool is_feed_visible;

  // Whether suggested articles are allowed. Typically set by policy.
  bool is_feed_allowed;

  // Whether prefetching for offline availability is enabled.
  bool is_prefetching_enabled;

  // Whether debugging the WebFeed follow intro is enabled.
  bool is_web_feed_follow_intro_debug_enabled;

  // Whether the legacy feed endpoint should be used.
  bool use_feed_query_requests;

  // Last load stream status, human readable.
  string load_stream_status;

  // Feed fetch URL.
  url.mojom.Url feed_fetch_url;

  // Feed upload actions URL.
  url.mojom.Url feed_actions_url;

  // Following feed order.
  FeedOrder following_feed_order;
};

struct LastFetchProperties {
  // Last fetch status.
  int32 last_fetch_status;

  // Reason for the last fetch.
  string last_fetch_trigger;

  // Last fetch time. Zero if there was no last fetch.
  mojo_base.mojom.TimeDelta last_fetch_time;

  // Time until which the scheduler will stop requesting refreshes.
  // Zero if there is direct user interaction.
  mojo_base.mojom.TimeDelta refresh_suppress_time;

  // For test server authentication.
  string last_bless_nonce;

  // Last net status for actions upload.
  int32 last_action_upload_status;

  // Last action upload time.
  mojo_base.mojom.TimeDelta last_action_upload_time;
};

// Browser interface for the page. Consists of calls for data and hooks for
// interactivity.
interface PageHandler {
  // Get general property values.
  GetGeneralProperties() => (Properties properties);

  // Get last fetch data.
  GetLastFetchProperties() => (LastFetchProperties properties);

  // Trigger a refresh of the For-you Feed.
  RefreshForYouFeed();

  // Trigger a refresh of the Following Feed.
  RefreshFollowingFeed();

  // Trigger a refresh of the Web Feed suggestions.
  RefreshWebFeedSuggestions();

  // Internal state dump of the Feed library's process scope. Human-readable.
  GetFeedProcessScopeDump() => (string dump);

  // Record all Feed metrics into a human-readable log.
  GetFeedHistograms() => (string log);

  // Overrides the scheme, host, and port used to make Feed Query requests.
  // Other URL components, like the path, are ignored.
  // Empty to clear override.
  // This allows for testing the Feed against a development server.
  OverrideFeedHost(url.mojom.Url host);

  // Overrides the scheme, host, and port used to make Discover API requests.
  // Other URL components, like the path, are ignored.
  // Empty to clear override.
  // This allows for testing the Feed against a development server.
  OverrideDiscoverApiEndpoint(url.mojom.Url endpoint_url);

  // Overrides the feed stream data with the payload inside a feedui::Slice for
  // testing purpose. See go/feed-stream-data-testing for more details.
  OverrideFeedStreamData(array<uint8> data);

  // Sets whether debugging the WebFeed follow intro is enabled.
  SetWebFeedFollowIntroDebugEnabled(bool enabled);

  // Sets whether the legacy feed endpoint should be used for Web Feed content
  // fetches.
  SetUseFeedQueryRequests(bool use_legacy);

  // Sets the Following feed order in local preferences.
  SetFollowingFeedOrder(FeedOrder order);
};