blob: 2ac1009827d09ceb6d20d18ee56b9ad1e813344c [file] [log] [blame]
// 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.
library chromium.web;
/// Provides methods for controlling and querying the navigation state
/// of a Frame.
protocol NavigationController {
/// Tells the Frame to navigate to a |url|.
/// |url|: The address to navigate to.
/// |params|: Additional parameters that affect how the resource will be
/// loaded (e.g. cookies, HTTP headers, etc.)
LoadUrl(string url, LoadUrlParams params);
Reload(ReloadType type);
/// Returns information for the currently visible content regardless of
/// loading state, or a null entry if no content is being displayed.
GetVisibleEntry() -> (NavigationEntry? entry);
/// Additional parameters for modifying the behavior of LoadUrl().
table LoadUrlParams {
/// Provides a hint to the browser UI about how LoadUrl was triggered.
1: LoadUrlReason type;
/// The URL that linked to the resource being requested.
2: string referrer_url;
/// Should be set to true to propagate user activation to the frame. User
/// activation implies that the user is interacting with the web frame. It
/// enables some web features that are not available otherwise. For example
/// autoplay will work only when this flag is set to true.
3: bool was_user_activated;
/// Custom HTTP headers.
4: vector<bytes> headers;
/// Characterizes the origin of a LoadUrl request.
enum LoadUrlReason {
/// Navigation was initiated by the user following a link.
LINK = 0;
/// Navigation was initiated by a user-provided URL.
TYPED = 1;
/// Contains information about the Frame's navigation state.
/// The Frame's navigation history can be represented as an aggregation of
/// NavigationEntries.
struct NavigationEntry {
/// The page's URL.
string url;
/// The user-visible page title.
string title;
/// Indicates if an error occurred during this navigation.
bool is_error;
enum ReloadType {
/// Reloads the current entry, bypassing the cache for the main resource.
/// Reloads the current entry, bypassing the cache entirely.