| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module web_view.mojom; | |
| 6 | |
| 7 import "components/mus/public/interfaces/window_tree.mojom"; | |
| 8 import "network/public/interfaces/url_loader.mojom"; | |
| 9 | |
| 10 enum ButtonState { | |
| 11 ENABLED, | |
| 12 DISABLED, | |
| 13 }; | |
| 14 | |
| 15 interface WebViewClient { | |
| 16 // Page-generated request for a top level frame navigation. | |
| 17 TopLevelNavigateRequest(mojo.URLRequest request); | |
| 18 | |
| 19 // Notification that the navigation has started. This can be useful for | |
| 20 // navigations triggered from sources other than the page itself (e.g. | |
| 21 // back/forward history navigation). | |
| 22 TopLevelNavigationStarted(string url); | |
| 23 | |
| 24 // Loading and progress notifications. | |
| 25 LoadingStateChanged(bool is_loading, double progress); | |
| 26 BackForwardChanged(ButtonState back_button, ButtonState forward_button); | |
| 27 | |
| 28 // TODO(beng): also forward text direction. | |
| 29 TitleChanged(string? title); | |
| 30 | |
| 31 // Reports the number of matches for a given Find() call. | |
| 32 FindInPageMatchCountUpdated(int32 request_id, int32 count, bool final_update); | |
| 33 | |
| 34 // Reports which find match is selected. (If there are five highlighted | |
| 35 // matches on a page, and the 2nd is selected, |active_match_ordinal| is 2.) | |
| 36 FindInPageSelectionUpdated(int32 request_id, int32 active_match_ordinal); | |
| 37 }; | |
| 38 | |
| 39 interface WebView { | |
| 40 // Navigate the top level frame to |request|. | |
| 41 LoadRequest(mojo.URLRequest request); | |
| 42 | |
| 43 // Provide a WindowTreeClient for this specific WebView. | |
| 44 GetWindowTreeClient(mus.mojom.WindowTreeClient& window_tree_client); | |
| 45 | |
| 46 // Finds a string in page. | |
| 47 Find(string search_text, bool forward_direction); | |
| 48 StopFinding(); | |
| 49 | |
| 50 // Moves forward and backward. | |
| 51 GoBack(); | |
| 52 GoForward(); | |
| 53 }; | |
| 54 | |
| 55 interface WebViewFactory { | |
| 56 CreateWebView(WebViewClient client, WebView& web_view); | |
| 57 }; | |
| OLD | NEW |