Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1150)

Side by Side Diff: chrome/renderer/spellchecker/spellcheck.h

Issue 105493002: Use base namespace for string16 in chrome/renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ 5 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_
6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ 6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // In addition, finds the suggested words for a given word 64 // In addition, finds the suggested words for a given word
65 // and puts them into |*optional_suggestions|. 65 // and puts them into |*optional_suggestions|.
66 // If the word is spelled correctly, the vector is empty. 66 // If the word is spelled correctly, the vector is empty.
67 // If optional_suggestions is NULL, suggested words will not be looked up. 67 // If optional_suggestions is NULL, suggested words will not be looked up.
68 // Note that Doing suggest lookups can be slow. 68 // Note that Doing suggest lookups can be slow.
69 bool SpellCheckWord(const char16* in_word, 69 bool SpellCheckWord(const char16* in_word,
70 int in_word_len, 70 int in_word_len,
71 int tag, 71 int tag,
72 int* misspelling_start, 72 int* misspelling_start,
73 int* misspelling_len, 73 int* misspelling_len,
74 std::vector<string16>* optional_suggestions); 74 std::vector<base::string16>* optional_suggestions);
75 75
76 // SpellCheck a paragraph. 76 // SpellCheck a paragraph.
77 // Returns true if |text| is correctly spelled, false otherwise. 77 // Returns true if |text| is correctly spelled, false otherwise.
78 // If the spellchecker failed to initialize, always returns true. 78 // If the spellchecker failed to initialize, always returns true.
79 bool SpellCheckParagraph( 79 bool SpellCheckParagraph(
80 const string16& text, 80 const base::string16& text,
81 blink::WebVector<blink::WebTextCheckingResult>* results); 81 blink::WebVector<blink::WebTextCheckingResult>* results);
82 82
83 // Find a possible correctly spelled word for a misspelled word. Computes an 83 // Find a possible correctly spelled word for a misspelled word. Computes an
84 // empty string if input misspelled word is too long, there is ambiguity, or 84 // empty string if input misspelled word is too long, there is ambiguity, or
85 // the correct spelling cannot be determined. 85 // the correct spelling cannot be determined.
86 // NOTE: If using the platform spellchecker, this will send a *lot* of sync 86 // NOTE: If using the platform spellchecker, this will send a *lot* of sync
87 // IPCs. We should probably refactor this if we ever plan to take it out from 87 // IPCs. We should probably refactor this if we ever plan to take it out from
88 // behind its command line flag. 88 // behind its command line flag.
89 string16 GetAutoCorrectionWord(const string16& word, int tag); 89 base::string16 GetAutoCorrectionWord(const base::string16& word, int tag);
90 90
91 // Requests to spellcheck the specified text in the background. This function 91 // Requests to spellcheck the specified text in the background. This function
92 // posts a background task and calls SpellCheckParagraph() in the task. 92 // posts a background task and calls SpellCheckParagraph() in the task.
93 #if !defined (OS_MACOSX) 93 #if !defined (OS_MACOSX)
94 void RequestTextChecking(const string16& text, 94 void RequestTextChecking(const base::string16& text,
95 blink::WebTextCheckingCompletion* completion); 95 blink::WebTextCheckingCompletion* completion);
96 #endif 96 #endif
97 97
98 // Creates a list of WebTextCheckingResult objects (used by WebKit) from a 98 // Creates a list of WebTextCheckingResult objects (used by WebKit) from a
99 // list of SpellCheckResult objects (used by Chrome). This function also 99 // list of SpellCheckResult objects (used by Chrome). This function also
100 // checks misspelled words returned by the Spelling service and changes the 100 // checks misspelled words returned by the Spelling service and changes the
101 // underline colors of contextually-misspelled words. 101 // underline colors of contextually-misspelled words.
102 void CreateTextCheckingResults( 102 void CreateTextCheckingResults(
103 ResultFilter filter, 103 ResultFilter filter,
104 int line_offset, 104 int line_offset,
105 const string16& line_text, 105 const base::string16& line_text,
106 const std::vector<SpellCheckResult>& spellcheck_results, 106 const std::vector<SpellCheckResult>& spellcheck_results,
107 blink::WebVector<blink::WebTextCheckingResult>* textcheck_results); 107 blink::WebVector<blink::WebTextCheckingResult>* textcheck_results);
108 108
109 bool is_spellcheck_enabled() { return spellcheck_enabled_; } 109 bool is_spellcheck_enabled() { return spellcheck_enabled_; }
110 110
111 private: 111 private:
112 friend class SpellCheckTest; 112 friend class SpellCheckTest;
113 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest, GetAutoCorrectionWord_EN_US); 113 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest, GetAutoCorrectionWord_EN_US);
114 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest, 114 FRIEND_TEST_ALL_PREFIXES(SpellCheckTest,
115 RequestSpellCheckMultipleTimesWithoutInitialization); 115 RequestSpellCheckMultipleTimesWithoutInitialization);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // Remember state for auto spell correct. 153 // Remember state for auto spell correct.
154 bool auto_spell_correct_turned_on_; 154 bool auto_spell_correct_turned_on_;
155 155
156 // Remember state for spellchecking. 156 // Remember state for spellchecking.
157 bool spellcheck_enabled_; 157 bool spellcheck_enabled_;
158 158
159 DISALLOW_COPY_AND_ASSIGN(SpellCheck); 159 DISALLOW_COPY_AND_ASSIGN(SpellCheck);
160 }; 160 };
161 161
162 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ 162 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_
OLDNEW
« no previous file with comments | « chrome/renderer/spellchecker/hunspell_engine.cc ('k') | chrome/renderer/spellchecker/spellcheck.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698