| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #define WebViewClient_h | 32 #define WebViewClient_h |
| 33 | 33 |
| 34 #include "../platform/WebColor.h" | 34 #include "../platform/WebColor.h" |
| 35 #include "../platform/WebGraphicsContext3D.h" | 35 #include "../platform/WebGraphicsContext3D.h" |
| 36 #include "../platform/WebString.h" | 36 #include "../platform/WebString.h" |
| 37 #include "WebAXEnums.h" | 37 #include "WebAXEnums.h" |
| 38 #include "WebContentDetectionResult.h" | 38 #include "WebContentDetectionResult.h" |
| 39 #include "WebDragOperation.h" | 39 #include "WebDragOperation.h" |
| 40 #include "WebFileChooserCompletion.h" | 40 #include "WebFileChooserCompletion.h" |
| 41 #include "WebFileChooserParams.h" | 41 #include "WebFileChooserParams.h" |
| 42 #include "WebFrame.h" |
| 42 #include "WebNavigatorContentUtilsClient.h" | 43 #include "WebNavigatorContentUtilsClient.h" |
| 43 #include "WebPageVisibilityState.h" | 44 #include "WebPageVisibilityState.h" |
| 44 #include "WebPopupType.h" | 45 #include "WebPopupType.h" |
| 45 #include "WebTextAffinity.h" | 46 #include "WebTextAffinity.h" |
| 46 #include "WebTextDirection.h" | 47 #include "WebTextDirection.h" |
| 47 #include "WebWidgetClient.h" | 48 #include "WebWidgetClient.h" |
| 48 | 49 |
| 49 namespace blink { | 50 namespace blink { |
| 50 | 51 |
| 51 class WebAXObject; | 52 class WebAXObject; |
| 52 class WebColorChooser; | 53 class WebColorChooser; |
| 53 class WebColorChooserClient; | 54 class WebColorChooserClient; |
| 54 class WebCompositorOutputSurface; | 55 class WebCompositorOutputSurface; |
| 55 class WebDateTimeChooserCompletion; | 56 class WebDateTimeChooserCompletion; |
| 56 class WebDragData; | 57 class WebDragData; |
| 57 class WebElement; | 58 class WebElement; |
| 58 class WebExternalPopupMenu; | 59 class WebExternalPopupMenu; |
| 59 class WebExternalPopupMenuClient; | 60 class WebExternalPopupMenuClient; |
| 60 class WebFileChooserCompletion; | 61 class WebFileChooserCompletion; |
| 61 class WebFrame; | |
| 62 class WebGeolocationClient; | 62 class WebGeolocationClient; |
| 63 class WebGeolocationService; | 63 class WebGeolocationService; |
| 64 class WebGestureEvent; | 64 class WebGestureEvent; |
| 65 class WebHitTestResult; | 65 class WebHitTestResult; |
| 66 class WebImage; | 66 class WebImage; |
| 67 class WebInputElement; | 67 class WebInputElement; |
| 68 class WebKeyboardEvent; | 68 class WebKeyboardEvent; |
| 69 class WebMIDIClient; | 69 class WebMIDIClient; |
| 70 class WebNode; | 70 class WebNode; |
| 71 class WebNotificationPresenter; | 71 class WebNotificationPresenter; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 95 public: | 95 public: |
| 96 // Factory methods ----------------------------------------------------- | 96 // Factory methods ----------------------------------------------------- |
| 97 | 97 |
| 98 // Create a new related WebView. This method must clone its session storage | 98 // Create a new related WebView. This method must clone its session storage |
| 99 // so any subsequent calls to createSessionStorageNamespace conform to the | 99 // so any subsequent calls to createSessionStorageNamespace conform to the |
| 100 // WebStorage specification. | 100 // WebStorage specification. |
| 101 // The request parameter is only for the client to check if the request | 101 // The request parameter is only for the client to check if the request |
| 102 // could be fulfilled. The client should not load the request. | 102 // could be fulfilled. The client should not load the request. |
| 103 // The policy parameter indicates how the new view will be displayed in | 103 // The policy parameter indicates how the new view will be displayed in |
| 104 // WebWidgetClient::show. | 104 // WebWidgetClient::show. |
| 105 virtual WebView* createView(WebFrame* creator, | 105 virtual WebView* createView(WebLocalFrame* creator, |
| 106 const WebURLRequest& request, | 106 const WebURLRequest& request, |
| 107 const WebWindowFeatures& features, | 107 const WebWindowFeatures& features, |
| 108 const WebString& name, | 108 const WebString& name, |
| 109 WebNavigationPolicy policy, | 109 WebNavigationPolicy policy, |
| 110 bool suppressOpener) { | 110 bool suppressOpener) { |
| 111 return 0; | 111 return 0; |
| 112 } | 112 } |
| 113 | 113 |
| 114 // Create a new WebPopupMenu. In the second form, the client is | 114 // Create a new WebPopupMenu. In the second form, the client is |
| 115 // responsible for rendering the contents of the popup menu. | 115 // responsible for rendering the contents of the popup menu. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 128 virtual bool shouldReportDetailedMessageForSource(const WebString& source) {
return false; } | 128 virtual bool shouldReportDetailedMessageForSource(const WebString& source) {
return false; } |
| 129 | 129 |
| 130 // A new message was added to the console. | 130 // A new message was added to the console. |
| 131 virtual void didAddMessageToConsole( | 131 virtual void didAddMessageToConsole( |
| 132 const WebConsoleMessage&, const WebString& sourceName, unsigned sourceLi
ne, const WebString& stackTrace) { } | 132 const WebConsoleMessage&, const WebString& sourceName, unsigned sourceLi
ne, const WebString& stackTrace) { } |
| 133 | 133 |
| 134 // Called when script in the page calls window.print(). If frame is | 134 // Called when script in the page calls window.print(). If frame is |
| 135 // non-null, then it selects a particular frame, including its | 135 // non-null, then it selects a particular frame, including its |
| 136 // children, to print. Otherwise, the main frame and its children | 136 // children, to print. Otherwise, the main frame and its children |
| 137 // should be printed. | 137 // should be printed. |
| 138 virtual void printPage(WebFrame*) { } | 138 virtual void printPage(WebLocalFrame*) { } |
| 139 | 139 |
| 140 // Called to retrieve the provider of desktop notifications. | 140 // Called to retrieve the provider of desktop notifications. |
| 141 virtual WebNotificationPresenter* notificationPresenter() { return 0; } | 141 virtual WebNotificationPresenter* notificationPresenter() { return 0; } |
| 142 | 142 |
| 143 // This method enumerates all the files in the path. It returns immediately | 143 // This method enumerates all the files in the path. It returns immediately |
| 144 // and asynchronously invokes the WebFileChooserCompletion with all the | 144 // and asynchronously invokes the WebFileChooserCompletion with all the |
| 145 // files in the directory. Returns false if the WebFileChooserCompletion | 145 // files in the directory. Returns false if the WebFileChooserCompletion |
| 146 // will never be called. | 146 // will never be called. |
| 147 virtual bool enumerateChosenDirectory(const WebString& path, WebFileChooserC
ompletion*) { return false; } | 147 virtual bool enumerateChosenDirectory(const WebString& path, WebFileChooserC
ompletion*) { return false; } |
| 148 | 148 |
| 149 // Navigational -------------------------------------------------------- | 149 // Navigational -------------------------------------------------------- |
| 150 | 150 |
| 151 // These notifications bracket any loading that occurs in the WebView. | 151 // These notifications bracket any loading that occurs in the WebView. |
| 152 virtual void didStartLoading(bool toDifferentDocument) { } | 152 virtual void didStartLoading(bool toDifferentDocument) { } |
| 153 virtual void didStopLoading() { } | 153 virtual void didStopLoading() { } |
| 154 | 154 |
| 155 // Notification that some progress was made loading the current page. | 155 // Notification that some progress was made loading the current page. |
| 156 // loadProgress is a value between 0 (nothing loaded) and 1.0 (frame fully | 156 // loadProgress is a value between 0 (nothing loaded) and 1.0 (frame fully |
| 157 // loaded). | 157 // loaded). |
| 158 virtual void didChangeLoadProgress(WebFrame*, double loadProgress) { } | 158 virtual void didChangeLoadProgress(WebLocalFrame*, double loadProgress) { } |
| 159 | 159 |
| 160 // Editing ------------------------------------------------------------- | 160 // Editing ------------------------------------------------------------- |
| 161 | 161 |
| 162 // These methods allow the client to intercept and overrule editing | 162 // These methods allow the client to intercept and overrule editing |
| 163 // operations. | 163 // operations. |
| 164 virtual void didCancelCompositionOnSelectionChange() { } | 164 virtual void didCancelCompositionOnSelectionChange() { } |
| 165 virtual void didChangeSelection(bool isSelectionEmpty) { } | 165 virtual void didChangeSelection(bool isSelectionEmpty) { } |
| 166 virtual void didChangeContents() { } | 166 virtual void didChangeContents() { } |
| 167 virtual void didExecuteCommand(const WebString& commandName) { } | 167 virtual void didExecuteCommand(const WebString& commandName) { } |
| 168 | 168 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 // Hide notifation popup for form validation messages. | 214 // Hide notifation popup for form validation messages. |
| 215 virtual void hideValidationMessage() { } | 215 virtual void hideValidationMessage() { } |
| 216 | 216 |
| 217 // Move the existing notifation popup to the new anchor position. | 217 // Move the existing notifation popup to the new anchor position. |
| 218 virtual void moveValidationMessage(const WebRect& anchorInRootView) { } | 218 virtual void moveValidationMessage(const WebRect& anchorInRootView) { } |
| 219 | 219 |
| 220 // Displays a modal alert dialog containing the given message. Returns | 220 // Displays a modal alert dialog containing the given message. Returns |
| 221 // once the user dismisses the dialog. | 221 // once the user dismisses the dialog. |
| 222 virtual void runModalAlertDialog( | 222 virtual void runModalAlertDialog( |
| 223 WebFrame*, const WebString& message) { } | 223 WebLocalFrame*, const WebString& message) { } |
| 224 | 224 |
| 225 // Displays a modal confirmation dialog with the given message as | 225 // Displays a modal confirmation dialog with the given message as |
| 226 // description and OK/Cancel choices. Returns true if the user selects | 226 // description and OK/Cancel choices. Returns true if the user selects |
| 227 // 'OK' or false otherwise. | 227 // 'OK' or false otherwise. |
| 228 virtual bool runModalConfirmDialog( | 228 virtual bool runModalConfirmDialog( |
| 229 WebFrame*, const WebString& message) { return false; } | 229 WebLocalFrame*, const WebString& message) { return false; } |
| 230 | 230 |
| 231 // Displays a modal input dialog with the given message as description | 231 // Displays a modal input dialog with the given message as description |
| 232 // and OK/Cancel choices. The input field is pre-filled with | 232 // and OK/Cancel choices. The input field is pre-filled with |
| 233 // defaultValue. Returns true if the user selects 'OK' or false | 233 // defaultValue. Returns true if the user selects 'OK' or false |
| 234 // otherwise. Upon returning true, actualValue contains the value of | 234 // otherwise. Upon returning true, actualValue contains the value of |
| 235 // the input field. | 235 // the input field. |
| 236 virtual bool runModalPromptDialog( | 236 virtual bool runModalPromptDialog( |
| 237 WebFrame*, const WebString& message, const WebString& defaultValue, | 237 WebLocalFrame*, const WebString& message, const WebString& defaultValue, |
| 238 WebString* actualValue) { return false; } | 238 WebString* actualValue) { return false; } |
| 239 | 239 |
| 240 // Displays a modal confirmation dialog containing the given message as | 240 // Displays a modal confirmation dialog containing the given message as |
| 241 // description and OK/Cancel choices, where 'OK' means that it is okay | 241 // description and OK/Cancel choices, where 'OK' means that it is okay |
| 242 // to proceed with closing the view. Returns true if the user selects | 242 // to proceed with closing the view. Returns true if the user selects |
| 243 // 'OK' or false otherwise. | 243 // 'OK' or false otherwise. |
| 244 virtual bool runModalBeforeUnloadDialog( | 244 virtual bool runModalBeforeUnloadDialog( |
| 245 WebFrame*, const WebString& message) { return true; } | 245 WebLocalFrame*, const WebString& message) { return true; } |
| 246 | 246 |
| 247 | 247 |
| 248 // UI ------------------------------------------------------------------ | 248 // UI ------------------------------------------------------------------ |
| 249 | 249 |
| 250 // Called when script modifies window.status | 250 // Called when script modifies window.status |
| 251 virtual void setStatusText(const WebString&) { } | 251 virtual void setStatusText(const WebString&) { } |
| 252 | 252 |
| 253 // Called when hovering over an anchor with the given URL. | 253 // Called when hovering over an anchor with the given URL. |
| 254 virtual void setMouseOverURL(const WebURL&) { } | 254 virtual void setMouseOverURL(const WebURL&) { } |
| 255 | 255 |
| 256 // Called when keyboard focus switches to an anchor with the given URL. | 256 // Called when keyboard focus switches to an anchor with the given URL. |
| 257 virtual void setKeyboardFocusURL(const WebURL&) { } | 257 virtual void setKeyboardFocusURL(const WebURL&) { } |
| 258 | 258 |
| 259 // Called when a drag-n-drop operation should begin. | 259 // Called when a drag-n-drop operation should begin. |
| 260 virtual void startDragging(WebFrame*, const WebDragData&, WebDragOperationsM
ask, const WebImage&, const WebPoint& dragImageOffset) { } | 260 virtual void startDragging(WebLocalFrame*, const WebDragData&, WebDragOperat
ionsMask, const WebImage&, const WebPoint& dragImageOffset) { } |
| 261 | 261 |
| 262 // Called to determine if drag-n-drop operations may initiate a page | 262 // Called to determine if drag-n-drop operations may initiate a page |
| 263 // navigation. | 263 // navigation. |
| 264 virtual bool acceptsLoadDrops() { return true; } | 264 virtual bool acceptsLoadDrops() { return true; } |
| 265 | 265 |
| 266 // Take focus away from the WebView by focusing an adjacent UI element | 266 // Take focus away from the WebView by focusing an adjacent UI element |
| 267 // in the containing window. | 267 // in the containing window. |
| 268 virtual void focusNext() { } | 268 virtual void focusNext() { } |
| 269 virtual void focusPrevious() { } | 269 virtual void focusPrevious() { } |
| 270 | 270 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 // Informs the browser that the draggable regions have been updated. | 409 // Informs the browser that the draggable regions have been updated. |
| 410 virtual void draggableRegionsChanged() { } | 410 virtual void draggableRegionsChanged() { } |
| 411 | 411 |
| 412 protected: | 412 protected: |
| 413 ~WebViewClient() { } | 413 ~WebViewClient() { } |
| 414 }; | 414 }; |
| 415 | 415 |
| 416 } // namespace blink | 416 } // namespace blink |
| 417 | 417 |
| 418 #endif | 418 #endif |
| OLD | NEW |