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