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 // |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 RequestNavigate(NavigationTargetType target_type, | 103 RequestNavigate(NavigationTargetType target_type, |
104 uint32 target_frame_id, | 104 uint32 target_frame_id, |
105 mojo.URLRequest request); | 105 mojo.URLRequest request); |
106 | 106 |
107 // The frame navigated locally, for example, pushState() navigations in an | 107 // The frame navigated locally, for example, pushState() navigations in an |
108 // HTML application. | 108 // HTML application. |
109 DidNavigateLocally(string url); | 109 DidNavigateLocally(string url); |
110 | 110 |
111 // Dispatches a load event to the parent of the frame. | 111 // Dispatches a load event to the parent of the frame. |
112 DispatchLoadEventToParent(); | 112 DispatchLoadEventToParent(); |
| 113 |
| 114 // Reports the number of matches for a given find. This is an asynchronous |
| 115 // notification and can fire multiple times per HighlightFindResults() call. |
| 116 OnFindInFrameCountUpdated(int32 request_id, int32 count, |
| 117 bool final_update); |
| 118 |
| 119 // Reports which match is currently highlighted. |
| 120 OnFindInPageSelectionUpdated(int32 request_id, int32 active_match_ordinal); |
113 }; | 121 }; |
114 | 122 |
115 enum ViewConnectType { | 123 enum ViewConnectType { |
116 // Indicates the app is already a ViewTreeClient and the existing view should | 124 // Indicates the app is already a ViewTreeClient and the existing view should |
117 // be used. In this case the app is not asked for a new ViewTreeClient. | 125 // be used. In this case the app is not asked for a new ViewTreeClient. |
118 USE_EXISTING, | 126 USE_EXISTING, |
119 | 127 |
120 // Indicates a new ViewTreeClient is obtained and the View provided to | 128 // Indicates a new ViewTreeClient is obtained and the View provided to |
121 // OnEmbed() should be used. | 129 // OnEmbed() should be used. |
122 USE_NEW | 130 USE_NEW |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Additionally it overlaps with the client properties. | 167 // Additionally it overlaps with the client properties. |
160 OnWillNavigate(string origin) => (); | 168 OnWillNavigate(string origin) => (); |
161 | 169 |
162 // Called to notify that |frame_id|'s loading state has changed. This is only | 170 // Called to notify that |frame_id|'s loading state has changed. This is only |
163 // called on the FrameClient rendering the parent of |frame_id|. | 171 // called on the FrameClient rendering the parent of |frame_id|. |
164 OnFrameLoadingStateChanged(uint32 frame_id, bool loading); | 172 OnFrameLoadingStateChanged(uint32 frame_id, bool loading); |
165 | 173 |
166 // Called to dispatch a load event of |frame_id| in its parent. This is only | 174 // Called to dispatch a load event of |frame_id| in its parent. This is only |
167 // called on the FrameClient rendering the parent of |frame_id|. | 175 // called on the FrameClient rendering the parent of |frame_id|. |
168 OnDispatchFrameLoadEvent(uint32 frame_id); | 176 OnDispatchFrameLoadEvent(uint32 frame_id); |
| 177 |
| 178 // TODO(erg): Several of these take a WebFindOptions struct; we probably need |
| 179 // to build a Frame version of that struct. |
| 180 |
| 181 // Searches for a given string. If a match is found, it will be |
| 182 // selected. Find() will only return true if it found a match, and will return |
| 183 // the result in the future through OnFindInPageSelectionUpdated(). That |
| 184 // callback will return |request_id|, and the listener should verify the |
| 185 // |request_id| on callback to guard against race conditions. |
| 186 // |
| 187 // |request_id| should be a monotonically increasing number which should only |
| 188 // be reused between Find() and the HighlightFindResults() calls that are |
| 189 // searching for the same string. |search_text| may be empty. |
| 190 Find(int32 request_id, string search_text) => (bool found); |
| 191 |
| 192 // Stop finding the single find result on the page. If |clear_selection| is |
| 193 // set, it will also clear the selected find text. |
| 194 StopFinding(bool clear_selection); |
| 195 |
| 196 // Match every instance of a string in a document asynchronously, highlighting |
| 197 // them and putting a tick mark in the scroll bar. This differs from Find() as |
| 198 // Find() is about finding the one selected instance of the text. |
| 199 // HighlightFindResults() is about highlighting all the instances of the text. |
| 200 // |
| 201 // HighlightFindResults() will asynchronously call |
| 202 // OnFindInFrameCountUpdated() multiple times to report its progress. |
| 203 HighlightFindResults(int32 request_id, string search_test, bool reset); |
| 204 |
| 205 // Removes the tick marks and highlighting done by HighlightFindResults() in |
| 206 // this frame. |
| 207 StopHighlightingFindResults(); |
169 }; | 208 }; |
OLD | NEW |