mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 22:36:09 +03:00
83 lines
2.2 KiB
Plaintext
83 lines
2.2 KiB
Plaintext
|
// 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<SuggestionItem> suggestions;
|
||
|
array<SuggestionItem> 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<string, string> properties);
|
||
|
|
||
|
// Populate the properties for the user classifier.
|
||
|
GetUserClassifierProperties() => (map<string, string> properties);
|
||
|
|
||
|
// Clear stored properties for the user classifier.
|
||
|
ClearUserClassifierProperties();
|
||
|
|
||
|
// Get category ranker tuples (abritrary field/values).
|
||
|
GetCategoryRankerProperties() => (map<string, string> properties);
|
||
|
|
||
|
// Reload the current suggestions.
|
||
|
ReloadSuggestions();
|
||
|
|
||
|
// Get the debug log.
|
||
|
GetDebugLog() => (string debugLog);
|
||
|
|
||
|
// Clear cached suggestions.
|
||
|
ClearCachedSuggestions();
|
||
|
|
||
|
// Get the remote content suggestions.
|
||
|
GetRemoteContentSuggestionsProperties() => (map<string, string> 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<SuggestionCategory> categories);
|
||
|
|
||
|
// Clear the dismissed suggestions.
|
||
|
ClearDismissedSuggestions(int64 category);
|
||
|
};
|
||
|
|
||
|
// Frontend interface.
|
||
|
interface Page {
|
||
|
OnSuggestionsChanged();
|
||
|
};
|