| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "public/platform/WebString.h" | 66 #include "public/platform/WebString.h" |
| 67 #include "public/platform/WebURL.h" | 67 #include "public/platform/WebURL.h" |
| 68 #include "public/platform/WebURLResponse.h" | 68 #include "public/platform/WebURLResponse.h" |
| 69 #include "public/platform/WebVector.h" | 69 #include "public/platform/WebVector.h" |
| 70 #include "public/web/WebContextMenuData.h" | 70 #include "public/web/WebContextMenuData.h" |
| 71 #include "public/web/WebFormElement.h" | 71 #include "public/web/WebFormElement.h" |
| 72 #include "public/web/WebFrameClient.h" | 72 #include "public/web/WebFrameClient.h" |
| 73 #include "public/web/WebMenuItemInfo.h" | 73 #include "public/web/WebMenuItemInfo.h" |
| 74 #include "public/web/WebPlugin.h" | 74 #include "public/web/WebPlugin.h" |
| 75 #include "public/web/WebSearchableFormData.h" | 75 #include "public/web/WebSearchableFormData.h" |
| 76 #include "public/web/WebSpellCheckClient.h" | 76 #include "public/web/WebTextCheckClient.h" |
| 77 #include "public/web/WebViewClient.h" | 77 #include "public/web/WebViewClient.h" |
| 78 #include "web/ContextMenuAllowedScope.h" | 78 #include "web/ContextMenuAllowedScope.h" |
| 79 #include "web/WebDataSourceImpl.h" | 79 #include "web/WebDataSourceImpl.h" |
| 80 #include "web/WebLocalFrameImpl.h" | 80 #include "web/WebLocalFrameImpl.h" |
| 81 #include "web/WebPluginContainerImpl.h" | 81 #include "web/WebPluginContainerImpl.h" |
| 82 #include "web/WebViewImpl.h" | 82 #include "web/WebViewImpl.h" |
| 83 #include "wtf/text/WTFString.h" | 83 #include "wtf/text/WTFString.h" |
| 84 | 84 |
| 85 namespace blink { | 85 namespace blink { |
| 86 | 86 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 // Spellchecker adds spelling markers to misspelled words and attaches | 321 // Spellchecker adds spelling markers to misspelled words and attaches |
| 322 // suggestions to these markers in the background. Therefore, when a | 322 // suggestions to these markers in the background. Therefore, when a |
| 323 // user right-clicks a mouse on a word, Chrome just needs to find a | 323 // user right-clicks a mouse on a word, Chrome just needs to find a |
| 324 // spelling marker on the word instead of spellchecking it. | 324 // spelling marker on the word instead of spellchecking it. |
| 325 String description; | 325 String description; |
| 326 data.misspelledWord = selectMisspellingAsync(selectedFrame, description); | 326 data.misspelledWord = selectMisspellingAsync(selectedFrame, description); |
| 327 if (description.length()) { | 327 if (description.length()) { |
| 328 Vector<String> suggestions; | 328 Vector<String> suggestions; |
| 329 description.split('\n', suggestions); | 329 description.split('\n', suggestions); |
| 330 data.dictionarySuggestions = suggestions; | 330 data.dictionarySuggestions = suggestions; |
| 331 } else if (m_webView->spellCheckClient()) { | 331 } else if (m_webView->textCheckClient()) { |
| 332 int misspelledOffset, misspelledLength; | 332 int misspelledOffset, misspelledLength; |
| 333 m_webView->spellCheckClient()->checkSpelling( | 333 m_webView->textCheckClient()->checkSpelling( |
| 334 data.misspelledWord, misspelledOffset, misspelledLength, | 334 data.misspelledWord, misspelledOffset, misspelledLength, |
| 335 &data.dictionarySuggestions); | 335 &data.dictionarySuggestions); |
| 336 } | 336 } |
| 337 | 337 |
| 338 HTMLFormElement* form = selectedFrame->selection().currentForm(); | 338 HTMLFormElement* form = selectedFrame->selection().currentForm(); |
| 339 if (form && isHTMLInputElement(*r.innerNode())) { | 339 if (form && isHTMLInputElement(*r.innerNode())) { |
| 340 HTMLInputElement& selectedElement = toHTMLInputElement(*r.innerNode()); | 340 HTMLInputElement& selectedElement = toHTMLInputElement(*r.innerNode()); |
| 341 WebSearchableFormData ws = WebSearchableFormData( | 341 WebSearchableFormData ws = WebSearchableFormData( |
| 342 WebFormElement(form), WebInputElement(&selectedElement)); | 342 WebFormElement(form), WebInputElement(&selectedElement)); |
| 343 if (ws.url().isValid()) | 343 if (ws.url().isValid()) |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 subMenuItems.swap(outputItems); | 452 subMenuItems.swap(outputItems); |
| 453 } | 453 } |
| 454 | 454 |
| 455 void ContextMenuClientImpl::populateCustomMenuItems( | 455 void ContextMenuClientImpl::populateCustomMenuItems( |
| 456 const ContextMenu* defaultMenu, | 456 const ContextMenu* defaultMenu, |
| 457 WebContextMenuData* data) { | 457 WebContextMenuData* data) { |
| 458 populateSubMenuItems(defaultMenu->items(), data->customItems); | 458 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 459 } | 459 } |
| 460 | 460 |
| 461 } // namespace blink | 461 } // namespace blink |
| OLD | NEW |