Index: components/web_view/public/interfaces/frame.mojom |
diff --git a/components/web_view/public/interfaces/frame.mojom b/components/web_view/public/interfaces/frame.mojom |
deleted file mode 100644 |
index 9505401e5ae98b15b70a45aad67c72fb56fe5ad5..0000000000000000000000000000000000000000 |
--- a/components/web_view/public/interfaces/frame.mojom |
+++ /dev/null |
@@ -1,222 +0,0 @@ |
-// Copyright 2015 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 web_view.mojom; |
- |
-import "network/public/interfaces/url_loader.mojom"; |
- |
-// This files defines the interfaces and structures used for frames. |
-// |
-// When a client in the frame tree is connected to by way of the WindowManager a |
-// FrameClient is obtained (from the ServiceProvider interface request passed |
-// in WindowManager::OnEmbed()). The FrameClient is told the frame tree (by way |
-// of OnConnection()), which allows the client to use other frames in the tree |
-// (assuming the client has the appropriate permissions). |
-// |
-// frame_ids are the same as windows ids. This means that when a client creates |
-// a new window to be part of the frame tree it immediately knows the id to use |
-// for Frame calls. |
-// |
-// The server provides an id that may be used to identify the state of the |
-// tree. The change id is an integer that is incremented every time the |
-// structure of the tree changes. The change id is not used by the server; the |
-// server only updates the change id and notifies clients of the new id (by |
-// way of structure change functions such as OnFrameAdded()). |
- |
-// Expresses a preference for where a navigation should occur. |
-enum NavigationTargetType { |
- // No preference. |
- NO_PREFERENCE, |
- |
- // In the specified frame. |
- EXISTING_FRAME, |
- |
- // In a new frame. |
- NEW_FRAME, |
-}; |
- |
-// Provides information about a frame. |
-struct FrameData { |
- // 0 if the frame has no parent (its the root). |
- uint32 parent_id; |
- uint32 frame_id; |
- |
- // A map of the properties supplied by the client. The server does not |
- // intepret these values in anyway, the meaning and usage is left up to |
- // clients. |
- map<string, array<uint8>>? client_properties; |
-}; |
- |
-// TODO(sky): decide which bits of this make sense for all frames, and move the |
-// html specific parts into properties. |
-struct HTMLMessageEvent { |
- // The serialized script value. |
- array<uint8>? data; |
- |
- // The origin of the source frame. |
- string source_origin; |
- |
- // The origin for the message's target. |
- string? target_origin; |
- |
- // TODO(sky): these two are not implemented. Figure out what they should be. |
- // Information about the MessagePorts this message contains. |
- // IPC_STRUCT_MEMBER(std::vector<content::TransferredMessagePort>, message_ports) |
- // IPC_STRUCT_MEMBER(std::vector<int>, new_routing_ids) |
-}; |
- |
-// Options used when performing a find-in-page query. |
-struct FindOptions { |
- // Whether to search forward or backward within the page. |
- bool forward = true; |
- |
- // Whether this operation is a follow-up to the last find. |
- bool continue_last_find = false; |
-}; |
- |
-interface Frame { |
- // Requests the server to message the specified frame with |event|. If the |
- // operation is allowed OnPostMessageEvent() is called on the appropriate |
- // FrameClient. |
- PostMessageEventToFrame(uint32 target_frame_id, HTMLMessageEvent event); |
- |
- // Notifies the server that the loading state and progress changed. |
- LoadingStateChanged(bool loading, double progress); |
- |
- // Called when the title becomes available or changes. |
- TitleChanged(string? title); |
- |
- // Called when the response body has been received. |
- DidCommitProvisionalLoad(); |
- |
- // Sets the value of the specified client property, notifying clients if the |
- // value changed. If |value| is null the property is removed. |
- SetClientProperty(string name, array<uint8>? value); |
- |
- // Called when the client creates a new frame. |frame_id| corresponds to |
- // the id of the window hosting the frame, and |parent_id| the id of the |
- // parent. See FrameData::client_properties for details of |
- // |client_properties|. |
- // |
- // Note that the FrameClient still gets an OnConnect(), but the only thing of |
- // interest is the callback. |
- OnCreatedFrame(Frame& frame_request, |
- FrameClient client, |
- uint32 frame_id, |
- map<string, array<uint8>> client_properties); |
- |
- // Requests a navigation. If |target_TYPE| is |EXISTING_FRAME|, then |
- // |target_frame_id| identifies the frame to navigate in. Otherwise |
- // |target_frame_id| is unused. |
- RequestNavigate(NavigationTargetType target_type, |
- uint32 target_frame_id, |
- mojo.URLRequest request); |
- |
- // The frame navigated locally, for example, pushState() navigations in an |
- // HTML application. |
- DidNavigateLocally(string url); |
- |
- // Dispatches a load event to the parent of the frame. |
- DispatchLoadEventToParent(); |
- |
- // Reports the number of matches for a given find. This is an asynchronous |
- // notification and can fire multiple times per HighlightFindResults() call. |
- OnFindInFrameCountUpdated(int32 request_id, int32 count, |
- bool final_update); |
- |
- // Reports which match is currently highlighted. |
- OnFindInPageSelectionUpdated(int32 request_id, int32 active_match_ordinal); |
-}; |
- |
-enum WindowConnectType { |
- // Indicates the app is already a WindowTreeClient and the existing window should |
- // be used. In this case the app is not asked for a new WindowTreeClient. |
- USE_EXISTING, |
- |
- // Indicates a new WindowTreeClient is obtained and the Window provided to |
- // OnEmbed() should be used. |
- USE_NEW |
-}; |
- |
-interface FrameClient { |
- // Called once per client. |frame_data| gives the contents of the tree. |
- // |window_id| is the id of the window the FrameClient should render to. If a |
- // WindowTreeClient is asked for then |window_id| is the same id as that of the |
- // Window supplied to WindowTreeClient::OnEmbed(). |navigation_start_time_ticks| |
- // is the time when the navigation resulting in this OnConnect() call was |
- // started. |
- OnConnect(Frame? frame, |
- uint32 change_id, |
- uint32 window_id, |
- WindowConnectType window_connect_type, |
- array<FrameData>? frame_data, |
- int64 navigation_start_time_ticks) => (); |
- |
- // Called when a new frame is added to the tree. |
- OnFrameAdded(uint32 change_id, FrameData frame_data); |
- |
- // Called when a frame is removed from the tree. |
- OnFrameRemoved(uint32 change_id, uint32 frame_id); |
- |
- // Called when a client property changes. |
- OnFrameClientPropertyChanged(uint32 frame_id, |
- string name, |
- array<uint8>? new_value); |
- |
- // See description in PostMessageEventToFrame(). |
- OnPostMessageEvent(uint32 source_frame_id, |
- uint32 target_frame_id, |
- HTMLMessageEvent event); |
- |
- // Called prior to starting a new navigation. This is only called on the |
- // FrameClient that is rendering to the frame, and only when another content |
- // handler is going to start handling the rendering. |
- // |
- // The new navigation is not started until the callback is run. |
- // |
- // TODO(sky): sort out origin. It needs to be more than a string. |
- // Additionally it overlaps with the client properties. |
- OnWillNavigate(string origin) => (); |
- |
- // Called to notify that |frame_id|'s loading state has changed. This is only |
- // called on the FrameClient rendering the parent of |frame_id|. |
- OnFrameLoadingStateChanged(uint32 frame_id, bool loading); |
- |
- // Called to dispatch a load event of |frame_id| in its parent. This is only |
- // called on the FrameClient rendering the parent of |frame_id|. |
- OnDispatchFrameLoadEvent(uint32 frame_id); |
- |
- // TODO(erg): Several of these take a WebFindOptions struct; we probably need |
- // to build a Frame version of that struct. |
- |
- // Searches for a given string. If a match is found, it will be |
- // selected. Find() will only return true if it found a match, and will return |
- // the result in the future through OnFindInPageSelectionUpdated(). That |
- // callback will return |request_id|, and the listener should verify the |
- // |request_id| on callback to guard against race conditions. |
- // |
- // |request_id| should be a monotonically increasing number which should only |
- // be reused between Find() and the HighlightFindResults() calls that are |
- // searching for the same string. |search_text| may be empty. |
- Find(int32 request_id, string search_text, FindOptions options, |
- bool wrap_within_frame) => (bool found); |
- |
- // Stop finding the single find result on the page. If |clear_selection| is |
- // set, it will also clear the selected find text. |
- StopFinding(bool clear_selection); |
- |
- // Match every instance of a string in a document asynchronously, highlighting |
- // them and putting a tick mark in the scroll bar. This differs from Find() as |
- // Find() is about finding the one selected instance of the text. |
- // HighlightFindResults() is about highlighting all the instances of the text. |
- // |
- // HighlightFindResults() will asynchronously call |
- // OnFindInFrameCountUpdated() multiple times to report its progress. |
- HighlightFindResults(int32 request_id, string search_text, |
- FindOptions options, bool reset); |
- |
- // Removes the tick marks and highlighting done by HighlightFindResults() in |
- // this frame. |
- StopHighlightingFindResults(); |
-}; |