summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker_mac.mm
Commit message (Collapse)AuthorAgeFilesLines
* Move Mac to using renderer spellchecker.estade@chromium.org2009-11-191-3/+4
| | | | | | | | BUG=25677 Review URL: http://codereview.chromium.org/395007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32561 0039d316-1c4b-4281-b951-d872f2087c98
* Move the spellchecker to the renderer.estade@chromium.org2009-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation is that this removes the sync IPC on every call to the spellchecker. Also, currently we spellcheck in the IO thread, which frequently needs to go to disk (in particular, the entire spellcheck dictionary starts paged out), so this will block just the single renderer when that happens, rather than the whole IO thread. This breaks the SpellChecker class into two new classes. 1) On the browser side, we have SpellCheckHost. This class handles browser-wide tasks, such as keeping the custom words list in sync with the on-disk custom words dictionary, downloading missing dictionaries, etc. On Posix, it also opens the bdic file since the renderer isn't allowed to open files. SpellCheckHost is created and destroyed on the UI thread. It is initialized on the file thread. 2) On the renderer side, SpellChecker2. This class will one day be renamed SpellChecker. It handles actual checking of the words, memory maps the dictionary file, loads hunspell, etc. There is one SpellChecker2 per RenderThread (hence one per render process). My intention is for this patch to move Linux to this new approach, and follow up with ports for Windows (which will involve passing a dictionary file name rather than a file descriptor through to the renderer) and Mac (which will involve adding sync ViewHost IPC callsfor when the platform spellchecker is enabled). Note that anyone using the platform spellchecker rather than Hunspell will get no benefit out of this refactor. There should be no loss of functionality for Linux (or any other platform) in this patch. The following should all still work: - dictionary is loaded lazily - hunspell is initialized lazily, per renderer - language changes work. - Dynamic downloading of new dictionaries - auto spell correct works (as well as toggling it). - disabling spellcheck works. - custom words work (including adding in one renderer and immediately having it take effect in other renderers, for certain values of "immediate") TODO: - move spellchecker unit tests to test SpellCheck2 - add sync IPC for platform spellchecker; port to Mac - add dictionary location fallback; port to Windows - remove SpellChecker classes from browser/ BUG=25677 Review URL: http://codereview.chromium.org/357003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31199 0039d316-1c4b-4281-b951-d872f2087c98
* Convert the spellchecker and associated messages and functions to use string16brettw@chromium.org2009-10-191-14/+15
| | | | | | | | | | | | for words instead of wstring. I also changed some places where it converted the word to a string to do that conversion at the last possible second before giving it to Hunspell (since this conversion isn't needed for Mac). TEST=Covered by unit tests BUG=none Review URL: http://codereview.chromium.org/274077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29435 0039d316-1c4b-4281-b951-d872f2087c98
* Use NSApp in preference to [NSApplication sharedApplicaton]mark@chromium.org2009-09-171-3/+0
| | | | | | | | BUG=0 TEST={} Review URL: http://codereview.chromium.org/207001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26480 0039d316-1c4b-4281-b951-d872f2087c98
* Adds support for the os x spelling panel to chromium. Users canpinkerton@chromium.org2009-09-091-7/+50
| | | | | | | | | | | now access it from the main menu and context menu and use it to perform spelling tasks. For more detail, see http://code.google.com/p/chromium/wiki/SpellingPanelPlanningDoc Patch from pwicks86@gmail.com (Paul Wicks). BUG=None TEST=The spelling panel should work in os x. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25786 0039d316-1c4b-4281-b951-d872f2087c98
* Adds languages supported by the platform spellchecker to the rightpinkerton@chromium.org2009-07-171-2/+36
| | | | | | | | | | | click menu. Also includes a couple of methods which will be needed once support for the spelling panel is finished. Patch from Paul Wicks (pwicks86@gmail.com) BUG=NONE TEST=Context menu on the mac should show and allow switching between languages for the spellchecker git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20951 0039d316-1c4b-4281-b951-d872f2087c98
* Change the use of typedef Language in Spell Check files back to std::string. ↵sidchat@google.com2009-07-071-3/+3
| | | | | | | | | | It is unnecessary, and is conflicting with enum Language definition for compact language detection library. BUG=none TEST=none Review URL: http://codereview.chromium.org/150139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20042 0039d316-1c4b-4281-b951-d872f2087c98
* Enable support for the Mac OS X spellchecking service in chromium.pinkerton@chromium.org2009-06-301-0/+135
spellchecker_platform_engine.h provides a basic interface for platform specific spellcheckers to follow. spellchecker_mac.mm implements these functions for the OS X spellchecking service. spellchecker_win.cc and spellchecker_linux.cc provide a space for future developments on these platforms. spellchecker_common.h contains a few shared variables and typedefs that are useful across all spellchecking code. spellchecker.cc has been modified to call the SpellCheckerPlatform::SpellCheckerAvailable() and use either hunspell or the platform spellchecker based on that call. Many new test cases have been added to one of the unit tests as well. chrome.gyp has been edited to reflect the added files. patch from pwicks86@gmail.com (paul wicks) BUG=13206 TEST=spellchecking works in web pages git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19585 0039d316-1c4b-4281-b951-d872f2087c98