| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 // This method is called in response to WebView's handleInputEvent() | 152 // This method is called in response to WebView's handleInputEvent() |
| 153 // when the default action for the current keyboard event is not | 153 // when the default action for the current keyboard event is not |
| 154 // suppressed by the page, to give the embedder a chance to handle | 154 // suppressed by the page, to give the embedder a chance to handle |
| 155 // the keyboard event specially. | 155 // the keyboard event specially. |
| 156 // | 156 // |
| 157 // Returns true if the keyboard event was handled by the embedder, | 157 // Returns true if the keyboard event was handled by the embedder, |
| 158 // indicating that the default action should be suppressed. | 158 // indicating that the default action should be suppressed. |
| 159 virtual bool handleCurrentKeyboardEvent() { return false; } | 159 virtual bool handleCurrentKeyboardEvent() { return false; } |
| 160 | 160 |
| 161 |
| 161 // Dialogs ------------------------------------------------------------- | 162 // Dialogs ------------------------------------------------------------- |
| 162 | 163 |
| 163 // This method opens the color chooser and returns a new WebColorChooser | 164 // This method opens the color chooser and returns a new WebColorChooser |
| 164 // instance. If there is a WebColorChooser already from the last time this | 165 // instance. If there is a WebColorChooser already from the last time this |
| 165 // was called, it ends the color chooser by calling endChooser, and replaces | 166 // was called, it ends the color chooser by calling endChooser, and replaces |
| 166 // it with the new one. The given list of suggestions can be used to show a | 167 // it with the new one. The given list of suggestions can be used to show a |
| 167 // simple interface with a limited set of choices. | 168 // simple interface with a limited set of choices. |
| 168 | 169 |
| 169 // FIXME: Should be removed when the chromium side change lands. | 170 // FIXME: Should be removed when the chromium side change lands. |
| 170 virtual WebColorChooser* createColorChooser(WebColorChooserClient*, | 171 virtual WebColorChooser* createColorChooser(WebColorChooserClient*, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 193 // besides the anchor rectangle. An implementation of this function should | 194 // besides the anchor rectangle. An implementation of this function should |
| 194 // not hide the popup until hideValidationMessage call. | 195 // not hide the popup until hideValidationMessage call. |
| 195 virtual void showValidationMessage(const WebRect& anchorInRootView, const We
bString& mainText, const WebString& supplementalText, WebTextDirection hint) { } | 196 virtual void showValidationMessage(const WebRect& anchorInRootView, const We
bString& mainText, const WebString& supplementalText, WebTextDirection hint) { } |
| 196 | 197 |
| 197 // Hide notifation popup for form validation messages. | 198 // Hide notifation popup for form validation messages. |
| 198 virtual void hideValidationMessage() { } | 199 virtual void hideValidationMessage() { } |
| 199 | 200 |
| 200 // Move the existing notifation popup to the new anchor position. | 201 // Move the existing notifation popup to the new anchor position. |
| 201 virtual void moveValidationMessage(const WebRect& anchorInRootView) { } | 202 virtual void moveValidationMessage(const WebRect& anchorInRootView) { } |
| 202 | 203 |
| 203 // Displays a modal alert dialog containing the given message. Returns | |
| 204 // once the user dismisses the dialog. | |
| 205 virtual void runModalAlertDialog( | |
| 206 WebLocalFrame*, const WebString& message) { } | |
| 207 | |
| 208 // Displays a modal confirmation dialog with the given message as | |
| 209 // description and OK/Cancel choices. Returns true if the user selects | |
| 210 // 'OK' or false otherwise. | |
| 211 virtual bool runModalConfirmDialog( | |
| 212 WebLocalFrame*, const WebString& message) { return false; } | |
| 213 | |
| 214 // Displays a modal input dialog with the given message as description | |
| 215 // and OK/Cancel choices. The input field is pre-filled with | |
| 216 // defaultValue. Returns true if the user selects 'OK' or false | |
| 217 // otherwise. Upon returning true, actualValue contains the value of | |
| 218 // the input field. | |
| 219 virtual bool runModalPromptDialog( | |
| 220 WebLocalFrame*, const WebString& message, const WebString& defaultValue, | |
| 221 WebString* actualValue) { return false; } | |
| 222 | |
| 223 // Displays a modal confirmation dialog containing the given message as | |
| 224 // description and OK/Cancel choices, where 'OK' means that it is okay | |
| 225 // to proceed with closing the view. Returns true if the user selects | |
| 226 // 'OK' or false otherwise. | |
| 227 virtual bool runModalBeforeUnloadDialog( | |
| 228 WebLocalFrame*, const WebString& message) { return true; } | |
| 229 | |
| 230 | 204 |
| 231 // UI ------------------------------------------------------------------ | 205 // UI ------------------------------------------------------------------ |
| 232 | 206 |
| 233 // Called when script modifies window.status | 207 // Called when script modifies window.status |
| 234 virtual void setStatusText(const WebString&) { } | 208 virtual void setStatusText(const WebString&) { } |
| 235 | 209 |
| 236 // Called when hovering over an anchor with the given URL. | 210 // Called when hovering over an anchor with the given URL. |
| 237 virtual void setMouseOverURL(const WebURL&) { } | 211 virtual void setMouseOverURL(const WebURL&) { } |
| 238 | 212 |
| 239 // Called when keyboard focus switches to an anchor with the given URL. | 213 // Called when keyboard focus switches to an anchor with the given URL. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 262 // After calling WebWidget::layout(), expect to get this notification | 236 // After calling WebWidget::layout(), expect to get this notification |
| 263 // unless the view did not need a layout. | 237 // unless the view did not need a layout. |
| 264 virtual void didUpdateLayout() { } | 238 virtual void didUpdateLayout() { } |
| 265 | 239 |
| 266 // Return true to swallow the input event if the embedder will start a disam
biguation popup | 240 // Return true to swallow the input event if the embedder will start a disam
biguation popup |
| 267 virtual bool didTapMultipleTargets(const WebGestureEvent&, const WebVector<W
ebRect>& targetRects) { return false; } | 241 virtual bool didTapMultipleTargets(const WebGestureEvent&, const WebVector<W
ebRect>& targetRects) { return false; } |
| 268 | 242 |
| 269 // Returns comma separated list of accept languages. | 243 // Returns comma separated list of accept languages. |
| 270 virtual WebString acceptLanguages() { return WebString(); } | 244 virtual WebString acceptLanguages() { return WebString(); } |
| 271 | 245 |
| 246 |
| 272 // Session history ----------------------------------------------------- | 247 // Session history ----------------------------------------------------- |
| 273 | 248 |
| 274 // Tells the embedder to navigate back or forward in session history by | 249 // Tells the embedder to navigate back or forward in session history by |
| 275 // the given offset (relative to the current position in session | 250 // the given offset (relative to the current position in session |
| 276 // history). | 251 // history). |
| 277 virtual void navigateBackForwardSoon(int offset) { } | 252 virtual void navigateBackForwardSoon(int offset) { } |
| 278 | 253 |
| 279 // Returns the number of history items before/after the current | 254 // Returns the number of history items before/after the current |
| 280 // history item. | 255 // history item. |
| 281 virtual int historyBackListCount() { return 0; } | 256 virtual int historyBackListCount() { return 0; } |
| 282 virtual int historyForwardListCount() { return 0; } | 257 virtual int historyForwardListCount() { return 0; } |
| 283 | 258 |
| 284 | 259 |
| 285 // Accessibility ------------------------------------------------------- | 260 // Accessibility ------------------------------------------------------- |
| 286 | 261 |
| 287 // Notifies embedder about an accessibility event. | 262 // Notifies embedder about an accessibility event. |
| 288 virtual void postAccessibilityEvent(const WebAXObject&, WebAXEvent) { } | 263 virtual void postAccessibilityEvent(const WebAXObject&, WebAXEvent) { } |
| 289 | 264 |
| 265 |
| 290 // Developer tools ----------------------------------------------------- | 266 // Developer tools ----------------------------------------------------- |
| 291 | 267 |
| 292 // Called to notify the client that the inspector's settings were | 268 // Called to notify the client that the inspector's settings were |
| 293 // changed and should be saved. See WebView::inspectorSettings. | 269 // changed and should be saved. See WebView::inspectorSettings. |
| 294 virtual void didUpdateInspectorSettings() { } | 270 virtual void didUpdateInspectorSettings() { } |
| 295 | 271 |
| 296 virtual void didUpdateInspectorSetting(const WebString& key, const WebString
& value) { } | 272 virtual void didUpdateInspectorSetting(const WebString& key, const WebString
& value) { } |
| 297 | 273 |
| 274 |
| 298 // Geolocation --------------------------------------------------------- | 275 // Geolocation --------------------------------------------------------- |
| 299 | 276 |
| 300 // Access the embedder API for (client-based) geolocation client . | 277 // Access the embedder API for (client-based) geolocation client . |
| 301 virtual WebGeolocationClient* geolocationClient() { return 0; } | 278 virtual WebGeolocationClient* geolocationClient() { return 0; } |
| 302 // Access the embedder API for (non-client-based) geolocation services. | 279 // Access the embedder API for (non-client-based) geolocation services. |
| 303 virtual WebGeolocationService* geolocationService() { return 0; } | 280 virtual WebGeolocationService* geolocationService() { return 0; } |
| 304 | 281 |
| 282 |
| 305 // Speech -------------------------------------------------------------- | 283 // Speech -------------------------------------------------------------- |
| 306 | 284 |
| 307 // Access the embedder API for speech input services. | 285 // Access the embedder API for speech input services. |
| 308 virtual WebSpeechInputController* speechInputController( | 286 virtual WebSpeechInputController* speechInputController( |
| 309 WebSpeechInputListener*) { return 0; } | 287 WebSpeechInputListener*) { return 0; } |
| 310 | 288 |
| 311 // Access the embedder API for speech recognition services. | 289 // Access the embedder API for speech recognition services. |
| 312 virtual WebSpeechRecognizer* speechRecognizer() { return 0; } | 290 virtual WebSpeechRecognizer* speechRecognizer() { return 0; } |
| 313 | 291 |
| 292 |
| 314 // Zoom ---------------------------------------------------------------- | 293 // Zoom ---------------------------------------------------------------- |
| 315 | 294 |
| 316 // Informs the browser that the zoom levels for this frame have changed from | 295 // Informs the browser that the zoom levels for this frame have changed from |
| 317 // the default values. | 296 // the default values. |
| 318 virtual void zoomLimitsChanged(double minimumLevel, double maximumLevel) { } | 297 virtual void zoomLimitsChanged(double minimumLevel, double maximumLevel) { } |
| 319 | 298 |
| 320 // Informs the browser that the zoom level has changed as a result of an | 299 // Informs the browser that the zoom level has changed as a result of an |
| 321 // action that wasn't initiated by the client. | 300 // action that wasn't initiated by the client. |
| 322 virtual void zoomLevelChanged() { } | 301 virtual void zoomLevelChanged() { } |
| 323 | 302 |
| 303 |
| 324 // Navigator Content Utils -------------------------------------------- | 304 // Navigator Content Utils -------------------------------------------- |
| 325 | 305 |
| 326 // Registers a new URL handler for the given protocol. | 306 // Registers a new URL handler for the given protocol. |
| 327 virtual void registerProtocolHandler(const WebString& scheme, | 307 virtual void registerProtocolHandler(const WebString& scheme, |
| 328 const WebURL& baseUrl, | 308 const WebURL& baseUrl, |
| 329 const WebURL& url, | 309 const WebURL& url, |
| 330 const WebString& title) | 310 const WebString& title) |
| 331 { | 311 { |
| 332 registerProtocolHandler(scheme, baseUrl.string(), url.string(), title); | 312 registerProtocolHandler(scheme, baseUrl.string(), url.string(), title); |
| 333 } | 313 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 350 const WebString& url, | 330 const WebString& url, |
| 351 const WebString& title) { } | 331 const WebString& title) { } |
| 352 | 332 |
| 353 virtual void unregisterProtocolHandler(const WebString& scheme, const WebStr
ing& baseUrl, const WebString& url) { } | 333 virtual void unregisterProtocolHandler(const WebString& scheme, const WebStr
ing& baseUrl, const WebString& url) { } |
| 354 | 334 |
| 355 virtual WebCustomHandlersState isProtocolHandlerRegistered(const WebString&
scheme, const WebString& baseUrl, const WebString& url) | 335 virtual WebCustomHandlersState isProtocolHandlerRegistered(const WebString&
scheme, const WebString& baseUrl, const WebString& url) |
| 356 { | 336 { |
| 357 return WebCustomHandlersNew; | 337 return WebCustomHandlersNew; |
| 358 } | 338 } |
| 359 | 339 |
| 340 |
| 360 // Visibility ----------------------------------------------------------- | 341 // Visibility ----------------------------------------------------------- |
| 361 | 342 |
| 362 // Returns the current visibility of the WebView. | 343 // Returns the current visibility of the WebView. |
| 363 virtual WebPageVisibilityState visibilityState() const | 344 virtual WebPageVisibilityState visibilityState() const |
| 364 { | 345 { |
| 365 return WebPageVisibilityStateVisible; | 346 return WebPageVisibilityStateVisible; |
| 366 } | 347 } |
| 367 | 348 |
| 349 |
| 368 // Media Streams ------------------------------------------------------- | 350 // Media Streams ------------------------------------------------------- |
| 369 | 351 |
| 370 virtual WebUserMediaClient* userMediaClient() { return 0; } | 352 virtual WebUserMediaClient* userMediaClient() { return 0; } |
| 371 | 353 |
| 354 |
| 372 // Web MIDI ------------------------------------------------------------- | 355 // Web MIDI ------------------------------------------------------------- |
| 373 | 356 |
| 374 virtual WebMIDIClient* webMIDIClient() { return 0; } | 357 virtual WebMIDIClient* webMIDIClient() { return 0; } |
| 375 | 358 |
| 376 // Push Messaging ------------------------------------------------------- | 359 // Push Messaging ------------------------------------------------------- |
| 377 | 360 |
| 378 virtual WebPushClient* webPushClient() { return 0; } | 361 virtual WebPushClient* webPushClient() { return 0; } |
| 379 | 362 |
| 380 // Content detection ---------------------------------------------------- | 363 // Content detection ---------------------------------------------------- |
| 381 | 364 |
| 382 // Retrieves detectable content (e.g., email addresses, phone numbers) | 365 // Retrieves detectable content (e.g., email addresses, phone numbers) |
| 383 // around a hit test result. The embedder should use platform-specific | 366 // around a hit test result. The embedder should use platform-specific |
| 384 // content detectors to analyze the region around the hit test result. | 367 // content detectors to analyze the region around the hit test result. |
| 385 virtual WebContentDetectionResult detectContentAround(const WebHitTestResult
&) { return WebContentDetectionResult(); } | 368 virtual WebContentDetectionResult detectContentAround(const WebHitTestResult
&) { return WebContentDetectionResult(); } |
| 386 | 369 |
| 387 // Schedules a new content intent with the provided url. | 370 // Schedules a new content intent with the provided url. |
| 388 virtual void scheduleContentIntent(const WebURL&) { } | 371 virtual void scheduleContentIntent(const WebURL&) { } |
| 389 | 372 |
| 390 // Cancels any previously scheduled content intents that have not yet launch
ed. | 373 // Cancels any previously scheduled content intents that have not yet launch
ed. |
| 391 virtual void cancelScheduledContentIntents() { } | 374 virtual void cancelScheduledContentIntents() { } |
| 392 | 375 |
| 376 |
| 393 // Draggable regions ---------------------------------------------------- | 377 // Draggable regions ---------------------------------------------------- |
| 394 | 378 |
| 395 // Informs the browser that the draggable regions have been updated. | 379 // Informs the browser that the draggable regions have been updated. |
| 396 virtual void draggableRegionsChanged() { } | 380 virtual void draggableRegionsChanged() { } |
| 397 | 381 |
| 398 protected: | 382 protected: |
| 399 ~WebViewClient() { } | 383 ~WebViewClient() { } |
| 400 }; | 384 }; |
| 401 | 385 |
| 402 } // namespace blink | 386 } // namespace blink |
| 403 | 387 |
| 404 #endif | 388 #endif |
| OLD | NEW |