| 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 "components/mus/public/interfaces/view_tree.mojom"; | 7 import "components/mus/public/interfaces/view_tree.mojom"; |
| 8 import "network/public/interfaces/url_loader.mojom"; | 8 import "network/public/interfaces/url_loader.mojom"; |
| 9 | 9 |
| 10 enum ButtonState { | 10 enum ButtonState { |
| 11 ENABLED, | 11 ENABLED, |
| 12 DISABLED, | 12 DISABLED, |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 interface WebViewClient { | 15 interface WebViewClient { |
| 16 // Page-generated request for a top level frame navigation. | 16 // Page-generated request for a top level frame navigation. |
| 17 TopLevelNavigate(mojo.URLRequest request); | 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); |
| 18 | 23 |
| 19 // Loading and progress notifications. | 24 // Loading and progress notifications. |
| 20 LoadingStateChanged(bool is_loading, double progress); | 25 LoadingStateChanged(bool is_loading, double progress); |
| 21 BackForwardChanged(ButtonState back_button, ButtonState forward_button); | 26 BackForwardChanged(ButtonState back_button, ButtonState forward_button); |
| 22 | 27 |
| 23 // TODO(beng): also forward text direction. | 28 // TODO(beng): also forward text direction. |
| 24 TitleChanged(string? title); | 29 TitleChanged(string? title); |
| 25 }; | 30 }; |
| 26 | 31 |
| 27 interface WebView { | 32 interface WebView { |
| 28 // Navigate the top level frame to |request|. | 33 // Navigate the top level frame to |request|. |
| 29 LoadRequest(mojo.URLRequest request); | 34 LoadRequest(mojo.URLRequest request); |
| 30 | 35 |
| 31 // Provide a ViewTreeClient for this specific WebView. | 36 // Provide a ViewTreeClient for this specific WebView. |
| 32 GetViewTreeClient(mojo.ViewTreeClient& view_tree_client); | 37 GetViewTreeClient(mojo.ViewTreeClient& view_tree_client); |
| 33 | 38 |
| 34 // Moves forward and backward. | 39 // Moves forward and backward. |
| 35 GoBack(); | 40 GoBack(); |
| 36 GoForward(); | 41 GoForward(); |
| 37 }; | 42 }; |
| 38 | 43 |
| 39 interface WebViewFactory { | 44 interface WebViewFactory { |
| 40 CreateWebView(WebViewClient client, WebView& web_view); | 45 CreateWebView(WebViewClient client, WebView& web_view); |
| 41 }; | 46 }; |
| OLD | NEW |