blob: facff8d11acb21f5ead7f1a790f27274f210d0f5 [file] [log] [blame]
// Copyright 2016 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 chrome.mojom;
import "mojo/public/mojom/base/string16.mojom";
import "mojo/public/mojom/base/time.mojom";
import "url/mojom/url.mojom";
[Native]
enum NTPLoggingEventType;
[Native]
enum OmniboxFocusState;
[Native]
struct NTPTileImpression;
// Interface used to connect to the embedded search interface. This is a
// separate interface such that a reverse connection (|client| below) can be
// passed when connecting.
interface EmbeddedSearchConnector {
// Connect to the interface. |embedded_search| is the connection which the
// client will use to query the embedded search interface. |client| is the
// connection used by the embedded search interface implementation to push
// browser state updates to the client.
Connect(associated EmbeddedSearch & embedded_search,
associated EmbeddedSearchClient client);
};
// Browser interface to support embedded search. Render frames connect to this
// interface to query browser data, such as the most visited pages.
// See http://dev.chromium.org/embeddedsearch
interface EmbeddedSearch {
// Tells InstantExtended to set the omnibox focus state.
FocusOmnibox(int32 page_seq_no, bool focus);
// Tells InstantExtended to delete a most visited item.
DeleteMostVisitedItem(int32 page_seq_no, url.mojom.Url url);
// Tells InstantExtended to undo all most visited item deletions.
UndoAllMostVisitedDeletions(int32 page_seq_no);
// Tells InstantExtended to undo one most visited item deletion.
UndoMostVisitedDeletion(int32 page_seq_no, url.mojom.Url url);
// Tells InstantExtended to add a custom link. Returns true if successful.
AddCustomLink(int32 page_seq_no, url.mojom.Url url, string title)
=> (bool success);
// Tells InstantExtended to update a custom link. Returns true if successful.
UpdateCustomLink(int32 page_seq_no,
url.mojom.Url url,
url.mojom.Url new_url,
string new_title) => (bool success);
// Tells InstantExtended to delete a custom link. Returns true if successful.
DeleteCustomLink(int32 page_seq_no, url.mojom.Url url) => (bool success);
// Tells InstantExtended to undo the previous custom link action (add, edit,
// delete, etc.).
UndoCustomLinkAction(int32 page_seq_no);
// Tells InstantExtended to delete all custom links and use most visited sites
// instead.
ResetCustomLinks(int32 page_seq_no);
// Tells InstantExtended to return true if the URL resolves and the edit
// custom link dialog has not timed out.
DoesUrlResolve(int32 page_seq_no, url.mojom.Url url)
=> (bool resolves, bool timeout);
// Logs events from InstantExtended New Tab Pages.
LogEvent(int32 page_seq_no,
NTPLoggingEventType event,
mojo_base.mojom.TimeDelta time);
// Logs an impression on one of the Most Visited tile on the InstantExtended
// New Tab Page.
LogMostVisitedImpression(int32 page_seq_no, NTPTileImpression impression);
// Logs a navigation on one of the Most Visited tile on the InstantExtended
// New Tab Page.
LogMostVisitedNavigation(int32 page_seq_no, NTPTileImpression impression);
// Tells InstantExtended to paste text into the omnibox. If text is empty,
// the clipboard contents will be pasted. This causes the omnibox dropdown to
// open.
PasteAndOpenDropdown(int32 page_seq_no,
mojo_base.mojom.String16 text_to_be_pasted);
// The Instant page asks whether the user syncs its history.
HistorySyncCheck(int32 page_seq_no) => (bool sync_history);
// The Instant page asks for Chrome identity check against |identity|.
ChromeIdentityCheck(int32 page_seq_no, mojo_base.mojom.String16 identity)
=> (bool identity_match);
// Updates the NTP custom background preferences.
SetCustomBackgroundURL(url.mojom.Url url);
SetCustomBackgroundURLWithAttributions(url.mojom.Url background_url,
string attribution_line_1,
string attribution_line_2,
url.mojom.Url action_url);
// Let the user select a local file for the NTP background.
SelectLocalBackgroundImage();
};
[Native]
enum OmniboxFocusChangeReason;
[Native]
struct InstantMostVisitedItem;
[Native]
struct ThemeBackgroundInfo;
// Renderer interface used by the browser to push updates to the client. For
// example, the browser will tell the frame if the omnibox got focus.
interface EmbeddedSearchClient {
SetPageSequenceNumber(int32 page_seq_no);
FocusChanged(OmniboxFocusState new_focus_state,
OmniboxFocusChangeReason reason);
MostVisitedChanged(array<InstantMostVisitedItem> items, bool is_custom_links);
SetInputInProgress(bool input_in_progress);
ThemeChanged(ThemeBackgroundInfo value);
};
// SearchBouncer tracks the NTP URL specified by the default search provider,
// which should be transferred back to the browser process for potential
// reassignment to an Instant renderer process.
interface SearchBouncer {
SetNewTabPageURL(url.mojom.Url new_tab_page_url);
};