Changeset 83617 in webkit


Ignore:
Timestamp:
Apr 12, 2011 11:45:33 AM (13 years ago)
Author:
jam@chromium.org
Message:

2011-04-11 John Abd-El-Malek <jam@chromium.org>

Reviewed by Darin Fisher.

[chromium]: Get the list of misspelled words in the WebKit code insetad of in chromium's RenderView
https://bugs.webkit.org/show_bug.cgi?id=58260

  • public/WebContextMenuData.h:
  • public/WebSpellCheckClient.h: (WebKit::WebSpellCheckClient::spellCheck):
  • src/ContextMenuClientImpl.cpp: (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
  • src/EditorClientImpl.cpp: (WebKit::EditorClientImpl::checkSpellingOfString):
Location:
trunk/Source/WebKit/chromium
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r83613 r83617  
     12011-04-11  John Abd-El-Malek  <jam@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [chromium]: Get the list of misspelled words in the WebKit code insetad of in chromium's RenderView
     6        https://bugs.webkit.org/show_bug.cgi?id=58260
     7
     8        * public/WebContextMenuData.h:
     9        * public/WebSpellCheckClient.h:
     10        (WebKit::WebSpellCheckClient::spellCheck):
     11        * src/ContextMenuClientImpl.cpp:
     12        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
     13        * src/EditorClientImpl.cpp:
     14        (WebKit::EditorClientImpl::checkSpellingOfString):
     15
    1162011-04-12  Bill Budge  <bbudge@chromium.org>
    217
  • trunk/Source/WebKit/chromium/DEPS

    r83494 r83617  
    3333vars = {
    3434  'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
    35   'chromium_rev': '80890'
     35  'chromium_rev': '81274'
    3636}
    3737
  • trunk/Source/WebKit/chromium/public/WebContextMenuData.h

    r83545 r83617  
    112112    WebString misspelledWord;
    113113
     114    // If misspelledWord is not empty, holds suggestions from the dictionary.
     115    WebVector<WebString> dictionarySuggestions;
     116
    114117    // Whether context is editable.
    115118    bool isEditable;
  • trunk/Source/WebKit/chromium/public/WebSpellCheckClient.h

    r82008 r83617  
    3333
    3434#include "WebString.h"
     35#include "WebVector.h"
    3536
    3637namespace WebKit {
     
    3839class WebString;
    3940class WebTextCheckingCompletion;
     41
     42#define WEBSPELLCHECKCLIENT_HAS_SUGGESTIONS
    4043
    4144class WebSpellCheckClient {
     
    4548    // will point to the start of the misspelled word, and misspelledLength
    4649    // will indicates its length. Otherwise, if there was not a spelling
    47     // error, then upon return misspelledLength is 0.
    48     virtual void spellCheck(
    49         const WebString& text, int& misspelledOffset, int& misspelledLength) { }
     50    // error, then upon return misspelledLength is 0. If optional_suggestions
     51    // is given, then it will be filled with suggested words (not a cheap step).
     52    virtual void spellCheck(const WebString& text,
     53                            int& misspelledOffset,
     54                            int& misspelledLength,
     55                            WebVector<WebString>* optionalSuggestions) { }
    5056    // Requests asynchronous spelling and grammar checking, whose result should be
    5157    // returned by passed completion object.
  • trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp

    r83545 r83617  
    6262#include "WebPluginContainerImpl.h"
    6363#include "WebPoint.h"
     64#include "WebSpellCheckClient.h"
    6465#include "WebString.h"
    6566#include "WebURL.h"
     
    257258            data.isSpellCheckingEnabled = true;
    258259            // Spellchecking might be enabled for the field, but could be disabled on the node.
    259             if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode())
     260            if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) {
    260261                data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
     262                if (m_webView->spellCheckClient()) {
     263                    int misspelledOffset, misspelledLength;
     264                    m_webView->spellCheckClient()->spellCheck(
     265                        data.misspelledWord, misspelledOffset, misspelledLength,
     266                        &data.dictionarySuggestions);
     267                    if (!misspelledOffset)
     268                        data.misspelledWord.reset();
     269
     270                }
     271            }
    261272        }
    262273    }
  • trunk/Source/WebKit/chromium/src/EditorClientImpl.cpp

    r82952 r83617  
    859859    // Check to see if the provided text is spelled correctly.
    860860    if (isContinuousSpellCheckingEnabled() && m_webView->spellCheckClient())
    861         m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength);
     861        m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength, 0);
    862862    else {
    863863        spellLocation = 0;
Note: See TracChangeset for help on using the changeset viewer.