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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 data.misspellingHash = marker.hash(); | 309 data.misspellingHash = marker.hash(); |
310 if (marker.description().length()) { | 310 if (marker.description().length()) { |
311 Vector<String> suggestions; | 311 Vector<String> suggestions; |
312 marker.description().split('\n', suggestions); | 312 marker.description().split('\n', suggestions); |
313 data.dictionarySuggestions = suggestions; | 313 data.dictionarySuggestions = suggestions; |
314 } else if (m_webView->spellCheckClient()) { | 314 } else if (m_webView->spellCheckClient()) { |
315 int misspelledOffset, misspelledLength; | 315 int misspelledOffset, misspelledLength; |
316 m_webView->spellCheckClient()->spellCheck(data.misspelledWord, m
isspelledOffset, misspelledLength, &data.dictionarySuggestions); | 316 m_webView->spellCheckClient()->spellCheck(data.misspelledWord, m
isspelledOffset, misspelledLength, &data.dictionarySuggestions); |
317 } | 317 } |
318 } else { | 318 } else { |
319 data.isSpellCheckingEnabled = | 319 data.isSpellCheckingEnabled = |
320 m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellChe
ckingEnabled(); | 320 m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellChe
ckingEnabled(); |
321 // Spellchecking might be enabled for the field, but could be disabl
ed on the node. | 321 // Spellchecking might be enabled for the field, but could be disabl
ed on the node. |
322 if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabl
edInFocusedNode()) { | 322 if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabl
edInFocusedNode()) { |
323 data.misspelledWord = selectMisspelledWord(selectedFrame); | 323 data.misspelledWord = selectMisspelledWord(selectedFrame); |
324 if (m_webView->spellCheckClient()) { | 324 if (m_webView->spellCheckClient()) { |
325 int misspelledOffset, misspelledLength; | 325 int misspelledOffset, misspelledLength; |
326 m_webView->spellCheckClient()->spellCheck( | 326 m_webView->spellCheckClient()->spellCheck( |
327 data.misspelledWord, misspelledOffset, misspelledLength, | 327 data.misspelledWord, misspelledOffset, misspelledLength, |
328 &data.dictionarySuggestions); | 328 &data.dictionarySuggestions); |
329 if (!misspelledLength) | 329 if (!misspelledLength) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 outputItems[i] = subItems[i]; | 403 outputItems[i] = subItems[i]; |
404 subMenuItems.swap(outputItems); | 404 subMenuItems.swap(outputItems); |
405 } | 405 } |
406 | 406 |
407 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) | 407 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) |
408 { | 408 { |
409 populateSubMenuItems(defaultMenu->items(), data->customItems); | 409 populateSubMenuItems(defaultMenu->items(), data->customItems); |
410 } | 410 } |
411 | 411 |
412 } // namespace WebKit | 412 } // namespace WebKit |
OLD | NEW |