naiveproxy/chrome/browser/ui/webui/interventions_internals/interventions_internals.mojom
2018-02-02 05:49:39 -05:00

92 lines
3.1 KiB
Plaintext

// Copyright 2017 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 mojom;
import "url/mojo/url.mojom";
struct PreviewsStatus {
// The human readable description of the status that will be displayed on
// chrome://interventions-internals.
string description;
bool enabled;
};
struct PreviewsFlag {
// The human readable description of the flag that will be displayed on
// chrome://interventions-internals.
string description;
// The link to this flag in chrome://flags.
string link;
// The string representation of the flag value.
string value;
};
struct MessageLog {
// The tye of event message (E.g. "Navigation").
string type;
// The human readable description of the event.
string description;
// The url that associated with the event.
url.mojom.Url url;
// The time when the event happened in millisecond since Unix epoch.
int64 time;
};
interface InterventionsInternalsPageHandler {
// Returns a map of previews modes statuses.
// TODO(thanhdle): Change this to array type. crbug.com/786996.
GetPreviewsEnabled() => (map<string, PreviewsStatus> statuses);
// Returns a map of previews related flags details.
// TODO(thanhdle): Change this to array type. crbug.com/786996.
GetPreviewsFlagsDetails() => (map<string, PreviewsFlag> flags);
// Inject the client side page object.
SetClientPage(InterventionsInternalsPage page);
// Change the status of ignoring blacklist to |ignored|. |ignored| will
// indicate whether the blacklist decision would be ignored when deciding if a
// preview should be shown or not.
SetIgnorePreviewsBlacklistDecision(bool ignored);
};
interface InterventionsInternalsPage {
// Pushes a new log message to the page. This is called by
// InterventionsInternalsPageHandler when it receives a new MessageLog, and
// publishes it on the javscript side.
LogNewMessage(MessageLog log);
// Notify the page that |host| has been blacklisted at |time|. The method is
// called by InterventionsInternalsPageHandler when PreviewsUIService receives
// new blacklisted host.
OnBlacklistedHost(string host, int64 time);
// Notify the page that user blacklisted status has changed to |blacklisted|.
// The method is called by InterventionsInternalsPageHandler when user's
// blacklist status changes.
OnUserBlacklistedStatusChange(bool blacklisted);
// Notify the page that the blacklist is cleared at |time|. The method is
// called by InterventionsInternalsPageHandler when PreviewsUIService clears
// the blacklist.
OnBlacklistCleared(int64 time);
// Notify the page on the new estimated effective connection type is |type|.
// This is called by InterventionsInternalsPageHandler when the estimate
// network quality changes.
OnEffectiveConnectionTypeChanged(string type);
// Notify the page on whether the blacklist decision is considered or ignored.
// This method is called by InterventionsInternalsPageHandler when the status
// of ignore blacklist decision is updated to |ignored|.
OnIgnoreBlacklistDecisionStatusChanged(bool ignored);
};