OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module web_view.mojom; | 5 module web_view.mojom; |
6 | 6 |
7 import "network/public/interfaces/url_loader.mojom"; | 7 import "network/public/interfaces/url_loader.mojom"; |
8 | 8 |
9 // This files defines the interfaces and structures used for frames. | 9 // This files defines the interfaces and structures used for frames. |
10 // | 10 // |
11 // When a client in the frame tree is connected to by way of the ViewManager a | 11 // When a client in the frame tree is connected to by way of the WindowManager a |
12 // FrameClient is obtained (from the ServiceProvider interface request passed | 12 // FrameClient is obtained (from the ServiceProvider interface request passed |
13 // in ViewManager::OnEmbed()). The FrameClient is told the frame tree (by way | 13 // in WindowManager::OnEmbed()). The FrameClient is told the frame tree (by way |
14 // of OnConnection()), which allows the client to use other frames in the tree | 14 // of OnConnection()), which allows the client to use other frames in the tree |
15 // (assuming the client has the appropriate permissions). | 15 // (assuming the client has the appropriate permissions). |
16 // | 16 // |
17 // frame_ids are the same as views ids. This means that when a client creates | 17 // frame_ids are the same as windows ids. This means that when a client creates |
18 // a new view to be part of the frame tree it immediately knows the id to use | 18 // a new window to be part of the frame tree it immediately knows the id to use |
19 // for Frame calls. | 19 // for Frame calls. |
20 // | 20 // |
21 // The server provides an id that may be used to identify the state of the | 21 // The server provides an id that may be used to identify the state of the |
22 // tree. The change id is an integer that is incremented every time the | 22 // tree. The change id is an integer that is incremented every time the |
23 // structure of the tree changes. The change id is not used by the server; the | 23 // structure of the tree changes. The change id is not used by the server; the |
24 // server only updates the change id and notifies clients of the new id (by | 24 // server only updates the change id and notifies clients of the new id (by |
25 // way of structure change functions such as OnFrameAdded()). | 25 // way of structure change functions such as OnFrameAdded()). |
26 | 26 |
27 // Expresses a preference for where a navigation should occur. | 27 // Expresses a preference for where a navigation should occur. |
28 enum NavigationTargetType { | 28 enum NavigationTargetType { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 TitleChanged(string? title); | 88 TitleChanged(string? title); |
89 | 89 |
90 // Called when the response body has been received. | 90 // Called when the response body has been received. |
91 DidCommitProvisionalLoad(); | 91 DidCommitProvisionalLoad(); |
92 | 92 |
93 // Sets the value of the specified client property, notifying clients if the | 93 // Sets the value of the specified client property, notifying clients if the |
94 // value changed. If |value| is null the property is removed. | 94 // value changed. If |value| is null the property is removed. |
95 SetClientProperty(string name, array<uint8>? value); | 95 SetClientProperty(string name, array<uint8>? value); |
96 | 96 |
97 // Called when the client creates a new frame. |frame_id| corresponds to | 97 // Called when the client creates a new frame. |frame_id| corresponds to |
98 // the id of the view hosting the frame, and |parent_id| the id of the | 98 // the id of the window hosting the frame, and |parent_id| the id of the |
99 // parent. See FrameData::client_properties for details of | 99 // parent. See FrameData::client_properties for details of |
100 // |client_properties|. | 100 // |client_properties|. |
101 // | 101 // |
102 // Note that the FrameClient still gets an OnConnect(), but the only thing of | 102 // Note that the FrameClient still gets an OnConnect(), but the only thing of |
103 // interest is the callback. | 103 // interest is the callback. |
104 OnCreatedFrame(Frame& frame_request, | 104 OnCreatedFrame(Frame& frame_request, |
105 FrameClient client, | 105 FrameClient client, |
106 uint32 frame_id, | 106 uint32 frame_id, |
107 map<string, array<uint8>> client_properties); | 107 map<string, array<uint8>> client_properties); |
108 | 108 |
(...skipping 13 matching lines...) Expand all Loading... |
122 | 122 |
123 // Reports the number of matches for a given find. This is an asynchronous | 123 // Reports the number of matches for a given find. This is an asynchronous |
124 // notification and can fire multiple times per HighlightFindResults() call. | 124 // notification and can fire multiple times per HighlightFindResults() call. |
125 OnFindInFrameCountUpdated(int32 request_id, int32 count, | 125 OnFindInFrameCountUpdated(int32 request_id, int32 count, |
126 bool final_update); | 126 bool final_update); |
127 | 127 |
128 // Reports which match is currently highlighted. | 128 // Reports which match is currently highlighted. |
129 OnFindInPageSelectionUpdated(int32 request_id, int32 active_match_ordinal); | 129 OnFindInPageSelectionUpdated(int32 request_id, int32 active_match_ordinal); |
130 }; | 130 }; |
131 | 131 |
132 enum ViewConnectType { | 132 enum WindowConnectType { |
133 // Indicates the app is already a ViewTreeClient and the existing view should | 133 // Indicates the app is already a WindowTreeClient and the existing window sho
uld |
134 // be used. In this case the app is not asked for a new ViewTreeClient. | 134 // be used. In this case the app is not asked for a new WindowTreeClient. |
135 USE_EXISTING, | 135 USE_EXISTING, |
136 | 136 |
137 // Indicates a new ViewTreeClient is obtained and the View provided to | 137 // Indicates a new WindowTreeClient is obtained and the Window provided to |
138 // OnEmbed() should be used. | 138 // OnEmbed() should be used. |
139 USE_NEW | 139 USE_NEW |
140 }; | 140 }; |
141 | 141 |
142 interface FrameClient { | 142 interface FrameClient { |
143 // Called once per client. |frame_data| gives the contents of the tree. | 143 // Called once per client. |frame_data| gives the contents of the tree. |
144 // |view_id| is the id of the view the FrameClient should render to. If a | 144 // |window_id| is the id of the window the FrameClient should render to. If a |
145 // ViewTreeClient is asked for then |view_id| is the same id as that of the | 145 // WindowTreeClient is asked for then |window_id| is the same id as that of th
e |
146 // View supplied to ViewTreeClient::OnEmbed(). |navigation_start_time_ticks| | 146 // Window supplied to WindowTreeClient::OnEmbed(). |navigation_start_time_tick
s| |
147 // is the time when the navigation resulting in this OnConnect() call was | 147 // is the time when the navigation resulting in this OnConnect() call was |
148 // started. | 148 // started. |
149 OnConnect(Frame? frame, | 149 OnConnect(Frame? frame, |
150 uint32 change_id, | 150 uint32 change_id, |
151 uint32 view_id, | 151 uint32 window_id, |
152 ViewConnectType view_connect_type, | 152 WindowConnectType window_connect_type, |
153 array<FrameData>? frame_data, | 153 array<FrameData>? frame_data, |
154 int64 navigation_start_time_ticks) => (); | 154 int64 navigation_start_time_ticks) => (); |
155 | 155 |
156 // Called when a new frame is added to the tree. | 156 // Called when a new frame is added to the tree. |
157 OnFrameAdded(uint32 change_id, FrameData frame_data); | 157 OnFrameAdded(uint32 change_id, FrameData frame_data); |
158 | 158 |
159 // Called when a frame is removed from the tree. | 159 // Called when a frame is removed from the tree. |
160 OnFrameRemoved(uint32 change_id, uint32 frame_id); | 160 OnFrameRemoved(uint32 change_id, uint32 frame_id); |
161 | 161 |
162 // Called when a client property changes. | 162 // Called when a client property changes. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 // | 213 // |
214 // HighlightFindResults() will asynchronously call | 214 // HighlightFindResults() will asynchronously call |
215 // OnFindInFrameCountUpdated() multiple times to report its progress. | 215 // OnFindInFrameCountUpdated() multiple times to report its progress. |
216 HighlightFindResults(int32 request_id, string search_text, | 216 HighlightFindResults(int32 request_id, string search_text, |
217 FindOptions options, bool reset); | 217 FindOptions options, bool reset); |
218 | 218 |
219 // Removes the tick marks and highlighting done by HighlightFindResults() in | 219 // Removes the tick marks and highlighting done by HighlightFindResults() in |
220 // this frame. | 220 // this frame. |
221 StopHighlightingFindResults(); | 221 StopHighlightingFindResults(); |
222 }; | 222 }; |
OLD | NEW |