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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // made visible until the new WebView's Delegate has its Show method called. | 100 // made visible until the new WebView's Delegate has its Show method called. |
101 // The returned WebView pointer is assumed to be owned by the host window, | 101 // The returned WebView pointer is assumed to be owned by the host window, |
102 // and the caller of CreateWebView should not release the given WebView. | 102 // and the caller of CreateWebView should not release the given WebView. |
103 // user_gesture is true if a user action initiated this call. | 103 // user_gesture is true if a user action initiated this call. |
104 virtual WebView* CreateWebView(WebView* webview, bool user_gesture) { | 104 virtual WebView* CreateWebView(WebView* webview, bool user_gesture) { |
105 return NULL; | 105 return NULL; |
106 } | 106 } |
107 | 107 |
108 // This method is called to create a new WebWidget to act as a popup | 108 // This method is called to create a new WebWidget to act as a popup |
109 // (like a drop-down menu). | 109 // (like a drop-down menu). |
110 virtual WebWidget* CreatePopupWidget(WebView* webview) { | 110 virtual WebWidget* CreatePopupWidget(WebView* webview, |
| 111 bool focus_on_show) { |
111 return NULL; | 112 return NULL; |
112 } | 113 } |
113 | 114 |
114 // This method is called to create a WebPluginDelegate implementation when a | 115 // This method is called to create a WebPluginDelegate implementation when a |
115 // new plugin is instanced. See webkit_glue::CreateWebPluginDelegateHelper | 116 // new plugin is instanced. See webkit_glue::CreateWebPluginDelegateHelper |
116 // for a default WebPluginDelegate implementation. | 117 // for a default WebPluginDelegate implementation. |
117 // TODO(port): clsid is very Win- and ActiveX-specific; refactor to be more | 118 // TODO(port): clsid is very Win- and ActiveX-specific; refactor to be more |
118 // platform-neutral | 119 // platform-neutral |
119 virtual WebPluginDelegate* CreatePluginDelegate( | 120 virtual WebPluginDelegate* CreatePluginDelegate( |
120 WebView* webview, | 121 WebView* webview, |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // Notification of possible password forms to be filled/submitted by | 444 // Notification of possible password forms to be filled/submitted by |
444 // the password manager | 445 // the password manager |
445 virtual void OnPasswordFormsSeen(WebView* webview, | 446 virtual void OnPasswordFormsSeen(WebView* webview, |
446 const std::vector<PasswordForm>& forms) { | 447 const std::vector<PasswordForm>& forms) { |
447 } | 448 } |
448 | 449 |
449 // | 450 // |
450 virtual void OnUnloadListenerChanged(WebView* webview, WebFrame* webframe) { | 451 virtual void OnUnloadListenerChanged(WebView* webview, WebFrame* webframe) { |
451 } | 452 } |
452 | 453 |
| 454 // Queries the browser for suggestions to be shown for the form text field |
| 455 // named |field_name|. |text| is the text entered by the user so far and |
| 456 // |node_id| is the id of the node of the input field. |
| 457 virtual void QueryFormFieldAutofill(const std::wstring& field_name, |
| 458 const std::wstring& text, |
| 459 int64 node_id) { |
| 460 } |
| 461 |
453 // UIDelegate -------------------------------------------------------------- | 462 // UIDelegate -------------------------------------------------------------- |
454 | 463 |
455 // Asks the browser to show a modal HTML dialog. The dialog is passed the | 464 // Asks the browser to show a modal HTML dialog. The dialog is passed the |
456 // given arguments as a JSON string, and returns its result as a JSON string | 465 // given arguments as a JSON string, and returns its result as a JSON string |
457 // through json_retval. | 466 // through json_retval. |
458 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, | 467 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, |
459 const std::string& json_arguments, | 468 const std::string& json_arguments, |
460 std::string* json_retval) { | 469 std::string* json_retval) { |
461 } | 470 } |
462 | 471 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 | 727 |
719 WebViewDelegate() { } | 728 WebViewDelegate() { } |
720 virtual ~WebViewDelegate() { } | 729 virtual ~WebViewDelegate() { } |
721 | 730 |
722 private: | 731 private: |
723 DISALLOW_EVIL_CONSTRUCTORS(WebViewDelegate); | 732 DISALLOW_EVIL_CONSTRUCTORS(WebViewDelegate); |
724 }; | 733 }; |
725 | 734 |
726 #endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H__ | 735 #endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H__ |
727 | 736 |
OLD | NEW |