| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // WebCore provides hooks for several kinds of functionality, allowing separate | 5 // WebCore provides hooks for several kinds of functionality, allowing separate |
| 6 // classes termed "delegates" to receive notifications (in the form of direct | 6 // classes termed "delegates" to receive notifications (in the form of direct |
| 7 // function calls) when certain events are about to occur or have just occurred. | 7 // function calls) when certain events are about to occur or have just occurred. |
| 8 // In some cases, the delegate implements the needed functionality; in others, | 8 // In some cases, the delegate implements the needed functionality; in others, |
| 9 // the delegate has some control over the behavior but doesn't actually | 9 // the delegate has some control over the behavior but doesn't actually |
| 10 // implement it. For example, the UI delegate is responsible for showing a | 10 // implement it. For example, the UI delegate is responsible for showing a |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 491 |
| 492 // Asks the browser to show a modal HTML dialog. The dialog is passed the | 492 // Asks the browser to show a modal HTML dialog. The dialog is passed the |
| 493 // given arguments as a JSON string, and returns its result as a JSON string | 493 // given arguments as a JSON string, and returns its result as a JSON string |
| 494 // through json_retval. | 494 // through json_retval. |
| 495 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, | 495 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, |
| 496 const std::string& json_arguments, | 496 const std::string& json_arguments, |
| 497 std::string* json_retval) { | 497 std::string* json_retval) { |
| 498 } | 498 } |
| 499 | 499 |
| 500 // Displays a JavaScript alert panel associated with the given view. Clients | 500 // Displays a JavaScript alert panel associated with the given view. Clients |
| 501 // should visually indicate that this panel comes from JavaScript. The panel | 501 // should visually indicate that this panel comes from JavaScript and some |
| 502 // information about the originating frame (at least the domain). The panel |
| 502 // should have a single OK button. | 503 // should have a single OK button. |
| 503 virtual void RunJavaScriptAlert(WebView* webview, | 504 virtual void RunJavaScriptAlert(WebFrame* webframe, |
| 504 const std::wstring& message) { | 505 const std::wstring& message) { |
| 505 } | 506 } |
| 506 | 507 |
| 507 // Displays a JavaScript confirm panel associated with the given view. | 508 // Displays a JavaScript confirm panel associated with the given view. |
| 508 // Clients should visually indicate that this panel comes | 509 // Clients should visually indicate that this panel comes |
| 509 // from JavaScript. The panel should have two buttons, e.g. "OK" and | 510 // from JavaScript. The panel should have two buttons, e.g. "OK" and |
| 510 // "Cancel". Returns true if the user hit OK, or false if the user hit Cancel. | 511 // "Cancel". Returns true if the user hit OK, or false if the user hit Cancel. |
| 511 virtual bool RunJavaScriptConfirm(WebView* webview, | 512 virtual bool RunJavaScriptConfirm(WebFrame* webframe, |
| 512 const std::wstring& message) { | 513 const std::wstring& message) { |
| 513 return false; | 514 return false; |
| 514 } | 515 } |
| 515 | 516 |
| 516 // Displays a JavaScript text input panel associated with the given view. | 517 // Displays a JavaScript text input panel associated with the given view. |
| 517 // Clients should visually indicate that this panel comes from JavaScript. | 518 // Clients should visually indicate that this panel comes from JavaScript. |
| 518 // The panel should have two buttons, e.g. "OK" and "Cancel", and an area to | 519 // The panel should have two buttons, e.g. "OK" and "Cancel", and an area to |
| 519 // type text. The default_value should appear as the initial text in the | 520 // type text. The default_value should appear as the initial text in the |
| 520 // panel when it is shown. If the user hit OK, returns true and fills result | 521 // panel when it is shown. If the user hit OK, returns true and fills result |
| 521 // with the text in the box. The value of result is undefined if the user | 522 // with the text in the box. The value of result is undefined if the user |
| 522 // hit Cancel. | 523 // hit Cancel. |
| 523 virtual bool RunJavaScriptPrompt(WebView* webview, | 524 virtual bool RunJavaScriptPrompt(WebFrame* webframe, |
| 524 const std::wstring& message, | 525 const std::wstring& message, |
| 525 const std::wstring& default_value, | 526 const std::wstring& default_value, |
| 526 std::wstring* result) { | 527 std::wstring* result) { |
| 527 return false; | 528 return false; |
| 528 } | 529 } |
| 529 | 530 |
| 530 // Sets the status bar text. | 531 // Sets the status bar text. |
| 531 virtual void SetStatusbarText(WebView* webview, | 532 virtual void SetStatusbarText(WebView* webview, |
| 532 const std::wstring& message) { } | 533 const std::wstring& message) { } |
| 533 | 534 |
| 534 // Displays a "before unload" confirm panel associated with the given view. | 535 // Displays a "before unload" confirm panel associated with the given view. |
| 535 // The panel should have two buttons, e.g. "OK" and "Cancel", where OK means | 536 // The panel should have two buttons, e.g. "OK" and "Cancel", where OK means |
| 536 // that the navigation should continue, and Cancel means that the navigation | 537 // that the navigation should continue, and Cancel means that the navigation |
| 537 // should be cancelled, leaving the user on the current page. Returns true | 538 // should be cancelled, leaving the user on the current page. Returns true |
| 538 // if the user hit OK, or false if the user hit Cancel. | 539 // if the user hit OK, or false if the user hit Cancel. |
| 539 virtual bool RunBeforeUnloadConfirm(WebView* webview, | 540 virtual bool RunBeforeUnloadConfirm(WebFrame* webframe, |
| 540 const std::wstring& message) { | 541 const std::wstring& message) { |
| 541 return true; // OK, continue to navigate away | 542 return true; // OK, continue to navigate away |
| 542 } | 543 } |
| 543 | 544 |
| 544 // Tells the client that we're hovering over a link with a given URL, | 545 // Tells the client that we're hovering over a link with a given URL, |
| 545 // if the node is not a link, the URL will be an empty GURL. | 546 // if the node is not a link, the URL will be an empty GURL. |
| 546 virtual void UpdateTargetURL(WebView* webview, | 547 virtual void UpdateTargetURL(WebView* webview, |
| 547 const GURL& url) { | 548 const GURL& url) { |
| 548 } | 549 } |
| 549 | 550 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 virtual void DidAddHistoryItem() { } | 773 virtual void DidAddHistoryItem() { } |
| 773 | 774 |
| 774 WebViewDelegate() { } | 775 WebViewDelegate() { } |
| 775 virtual ~WebViewDelegate() { } | 776 virtual ~WebViewDelegate() { } |
| 776 | 777 |
| 777 private: | 778 private: |
| 778 DISALLOW_COPY_AND_ASSIGN(WebViewDelegate); | 779 DISALLOW_COPY_AND_ASSIGN(WebViewDelegate); |
| 779 }; | 780 }; |
| 780 | 781 |
| 781 #endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ | 782 #endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ |
| OLD | NEW |