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

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

Issue 10533077: Implement a request cache and disble retrieving a sub-region. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months 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_PROVIDER_H_ 5 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_
6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ 6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const WebKit::WebString& word) OVERRIDE; 78 const WebKit::WebString& word) OVERRIDE;
79 79
80 #if !defined(OS_MACOSX) 80 #if !defined(OS_MACOSX)
81 void OnRespondSpellingService( 81 void OnRespondSpellingService(
82 int identifier, 82 int identifier,
83 int offset, 83 int offset,
84 bool succeeded, 84 bool succeeded,
85 const string16& text, 85 const string16& text,
86 const std::vector<SpellCheckResult>& results); 86 const std::vector<SpellCheckResult>& results);
87 87
88 // Returns whether |text| has word characters after |index|, i.e. whether a 88 // Returns whether |text| has word characters, i.e. whether a spellchecker
89 // spellchecker needs to check this text. 89 // needs to check this text.
90 bool HasWordCharacters(const string16& text, int index) const; 90 bool HasWordCharacters(const WebKit::WebString& text, int index) const;
91
92 // Returns a line that should be sent to a browser to spellcheck it.
93 bool GetRequestLine(const string16& text,
94 string16* request,
95 int* offset) const;
96 #endif 91 #endif
97 #if defined(OS_MACOSX) 92 #if defined(OS_MACOSX)
98 void OnAdvanceToNextMisspelling(); 93 void OnAdvanceToNextMisspelling();
99 void OnRespondTextCheck( 94 void OnRespondTextCheck(
100 int identifier, 95 int identifier,
101 int tag, 96 int tag,
102 const std::vector<SpellCheckResult>& results); 97 const std::vector<SpellCheckResult>& results);
103 void OnToggleSpellPanel(bool is_currently_visible); 98 void OnToggleSpellPanel(bool is_currently_visible);
104 #endif 99 #endif
105 void OnToggleSpellCheck(); 100 void OnToggleSpellCheck();
106 101
107 // Initializes the document_tag_ member if necessary. 102 // Initializes the document_tag_ member if necessary.
108 void EnsureDocumentTag(); 103 void EnsureDocumentTag();
109 104
110 // Holds ongoing spellchecking operations, assigns IDs for the IPC routing. 105 // Holds ongoing spellchecking operations, assigns IDs for the IPC routing.
111 WebTextCheckCompletions text_check_completions_; 106 WebTextCheckCompletions text_check_completions_;
112 107
113 #if !defined(OS_MACOSX) 108 #if !defined(OS_MACOSX)
114 // The last line sent to the browser process to spellcheck it. 109 // The last text sent to the browser process to spellcheck it and its
115 string16 last_line_; 110 // spellchecking results.
111 string16 last_request_;
112 WebKit::WebVector<WebKit::WebTextCheckingResult> last_results_;
116 #endif 113 #endif
117 114
118 #if defined(OS_MACOSX) 115 #if defined(OS_MACOSX)
119 // True if the current RenderView has been assigned a document tag. 116 // True if the current RenderView has been assigned a document tag.
120 bool has_document_tag_; 117 bool has_document_tag_;
121 #endif 118 #endif
122 119
123 int document_tag_; 120 int document_tag_;
124 121
125 // True if the browser is showing the spelling panel for us. 122 // True if the browser is showing the spelling panel for us.
126 bool spelling_panel_visible_; 123 bool spelling_panel_visible_;
127 124
128 // The ChromeContentRendererClient used to access the SpellChecker. 125 // The ChromeContentRendererClient used to access the SpellChecker.
129 // Weak reference. 126 // Weak reference.
130 chrome::ChromeContentRendererClient* chrome_content_renderer_client_; 127 chrome::ChromeContentRendererClient* chrome_content_renderer_client_;
131 128
132 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider); 129 DISALLOW_COPY_AND_ASSIGN(SpellCheckProvider);
133 }; 130 };
134 131
135 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_ 132 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698