Lines 117-124
Link Here
|
117 |
//////////////////////////////////////////////////////////////////////// |
117 |
//////////////////////////////////////////////////////////////////////// |
118 |
|
118 |
|
119 |
|
119 |
|
120 |
NS_INTERFACE_MAP_BEGIN(nsTypeAheadFind) |
120 |
NS_INTERFACE_MAP_BEGIN(nsTypeAheadFindSea) |
121 |
NS_INTERFACE_MAP_ENTRY(nsITypeAheadFind) |
121 |
NS_INTERFACE_MAP_ENTRY(nsITypeAheadFindSea) |
122 |
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) |
122 |
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) |
123 |
NS_INTERFACE_MAP_ENTRY(nsITimerCallback) |
123 |
NS_INTERFACE_MAP_ENTRY(nsITimerCallback) |
124 |
NS_INTERFACE_MAP_ENTRY(nsIScrollPositionListener) |
124 |
NS_INTERFACE_MAP_ENTRY(nsIScrollPositionListener) |
Lines 131-138
Link Here
|
131 |
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMKeyListener) |
131 |
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMKeyListener) |
132 |
NS_INTERFACE_MAP_END |
132 |
NS_INTERFACE_MAP_END |
133 |
|
133 |
|
134 |
NS_IMPL_ADDREF(nsTypeAheadFind) |
134 |
NS_IMPL_ADDREF(nsTypeAheadFindSea) |
135 |
NS_IMPL_RELEASE(nsTypeAheadFind) |
135 |
NS_IMPL_RELEASE(nsTypeAheadFindSea) |
136 |
|
136 |
|
137 |
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID); |
137 |
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID); |
138 |
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); |
138 |
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); |
Lines 141-151
Link Here
|
141 |
|
141 |
|
142 |
#define NS_FIND_CONTRACTID "@mozilla.org/embedcomp/rangefind;1" |
142 |
#define NS_FIND_CONTRACTID "@mozilla.org/embedcomp/rangefind;1" |
143 |
|
143 |
|
144 |
nsTypeAheadFind* nsTypeAheadFind::sInstance = nsnull; |
144 |
nsTypeAheadFindSea* nsTypeAheadFindSea::sInstance = nsnull; |
145 |
PRInt32 nsTypeAheadFind::sAccelKey = -1; // magic value of -1 when unitialized |
145 |
PRInt32 nsTypeAheadFindSea::sAccelKey = -1; // magic value of -1 when unitialized |
146 |
|
146 |
|
147 |
|
147 |
|
148 |
nsTypeAheadFind::nsTypeAheadFind(): |
148 |
nsTypeAheadFindSea::nsTypeAheadFindSea(): |
149 |
mIsFindAllowedInWindow(PR_FALSE), mAutoStartPref(PR_FALSE), |
149 |
mIsFindAllowedInWindow(PR_FALSE), mAutoStartPref(PR_FALSE), |
150 |
mLinksOnlyPref(PR_FALSE), mStartLinksOnlyPref(PR_FALSE), |
150 |
mLinksOnlyPref(PR_FALSE), mStartLinksOnlyPref(PR_FALSE), |
151 |
mLinksOnly(PR_FALSE), mIsTypeAheadOn(PR_FALSE), mCaretBrowsingOn(PR_FALSE), |
151 |
mLinksOnly(PR_FALSE), mIsTypeAheadOn(PR_FALSE), mCaretBrowsingOn(PR_FALSE), |
Lines 164-188
Link Here
|
164 |
static PRInt32 gInstanceCount; |
164 |
static PRInt32 gInstanceCount; |
165 |
++gInstanceCount; |
165 |
++gInstanceCount; |
166 |
NS_ASSERTION(gInstanceCount == 1, |
166 |
NS_ASSERTION(gInstanceCount == 1, |
167 |
"There should be only 1 instance of nsTypeAheadFind!"); |
167 |
"There should be only 1 instance of nsTypeAheadFindSea!"); |
168 |
#endif |
168 |
#endif |
169 |
} |
169 |
} |
170 |
|
170 |
|
171 |
|
171 |
|
172 |
nsTypeAheadFind::~nsTypeAheadFind() |
172 |
nsTypeAheadFindSea::~nsTypeAheadFindSea() |
173 |
{ |
173 |
{ |
174 |
RemoveDocListeners(); |
174 |
RemoveDocListeners(); |
175 |
mTimer = nsnull; |
175 |
mTimer = nsnull; |
176 |
|
176 |
|
177 |
nsCOMPtr<nsIPrefBranchInternal> prefInternal(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
177 |
nsCOMPtr<nsIPrefBranchInternal> prefInternal(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
178 |
if (prefInternal) { |
178 |
if (prefInternal) { |
179 |
prefInternal->RemoveObserver("accessibility.typeaheadfind", this); |
179 |
prefInternal->RemoveObserver("accessibility.typeaheadfindsea", this); |
180 |
prefInternal->RemoveObserver("accessibility.browsewithcaret", this); |
180 |
prefInternal->RemoveObserver("accessibility.browsewithcaret", this); |
181 |
} |
181 |
} |
182 |
} |
182 |
} |
183 |
|
183 |
|
184 |
nsresult |
184 |
nsresult |
185 |
nsTypeAheadFind::Init() |
185 |
nsTypeAheadFindSea::Init() |
186 |
{ |
186 |
{ |
187 |
nsresult rv = NS_NewISupportsArray(getter_AddRefs(mManualFindWindows)); |
187 |
nsresult rv = NS_NewISupportsArray(getter_AddRefs(mManualFindWindows)); |
188 |
NS_ENSURE_SUCCESS(rv, rv); |
188 |
NS_ENSURE_SUCCESS(rv, rv); |
Lines 199-205
Link Here
|
199 |
} |
199 |
} |
200 |
|
200 |
|
201 |
// ----------- Listen to prefs ------------------ |
201 |
// ----------- Listen to prefs ------------------ |
202 |
rv = prefInternal->AddObserver("accessibility.typeaheadfind", this, PR_FALSE); |
202 |
rv = prefInternal->AddObserver("accessibility.typeaheadfindsea", this, PR_FALSE); |
203 |
NS_ENSURE_SUCCESS(rv, rv); |
203 |
NS_ENSURE_SUCCESS(rv, rv); |
204 |
|
204 |
|
205 |
rv = prefInternal->AddObserver("accessibility.browsewithcaret", this, PR_FALSE); |
205 |
rv = prefInternal->AddObserver("accessibility.browsewithcaret", this, PR_FALSE); |
Lines 220-230
Link Here
|
220 |
return rv; |
220 |
return rv; |
221 |
} |
221 |
} |
222 |
|
222 |
|
223 |
nsTypeAheadFind * |
223 |
nsTypeAheadFindSea * |
224 |
nsTypeAheadFind::GetInstance() |
224 |
nsTypeAheadFindSea::GetInstance() |
225 |
{ |
225 |
{ |
226 |
if (!sInstance) { |
226 |
if (!sInstance) { |
227 |
sInstance = new nsTypeAheadFind(); |
227 |
sInstance = new nsTypeAheadFindSea(); |
228 |
if (!sInstance) |
228 |
if (!sInstance) |
229 |
return nsnull; |
229 |
return nsnull; |
230 |
|
230 |
|
Lines 244-257
Link Here
|
244 |
|
244 |
|
245 |
|
245 |
|
246 |
void |
246 |
void |
247 |
nsTypeAheadFind::ReleaseInstance() |
247 |
nsTypeAheadFindSea::ReleaseInstance() |
248 |
{ |
248 |
{ |
249 |
NS_IF_RELEASE(sInstance); |
249 |
NS_IF_RELEASE(sInstance); |
250 |
} |
250 |
} |
251 |
|
251 |
|
252 |
|
252 |
|
253 |
void |
253 |
void |
254 |
nsTypeAheadFind::Shutdown() |
254 |
nsTypeAheadFindSea::Shutdown() |
255 |
{ |
255 |
{ |
256 |
// Application shutdown |
256 |
// Application shutdown |
257 |
mTimer = nsnull; |
257 |
mTimer = nsnull; |
Lines 267-280
Link Here
|
267 |
// ------- Pref Callbacks (2) --------------- |
267 |
// ------- Pref Callbacks (2) --------------- |
268 |
|
268 |
|
269 |
nsresult |
269 |
nsresult |
270 |
nsTypeAheadFind::PrefsReset() |
270 |
nsTypeAheadFindSea::PrefsReset() |
271 |
{ |
271 |
{ |
272 |
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
272 |
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
273 |
NS_ENSURE_TRUE(prefBranch, NS_ERROR_FAILURE); |
273 |
NS_ENSURE_TRUE(prefBranch, NS_ERROR_FAILURE); |
274 |
|
274 |
|
275 |
PRBool wasTypeAheadOn = mIsTypeAheadOn; |
275 |
PRBool wasTypeAheadOn = mIsTypeAheadOn; |
276 |
|
276 |
|
277 |
prefBranch->GetBoolPref("accessibility.typeaheadfind", &mIsTypeAheadOn); |
277 |
prefBranch->GetBoolPref("accessibility.typeaheadfindsea", &mIsTypeAheadOn); |
278 |
|
278 |
|
279 |
if (mIsTypeAheadOn != wasTypeAheadOn) { |
279 |
if (mIsTypeAheadOn != wasTypeAheadOn) { |
280 |
if (!mIsTypeAheadOn) { |
280 |
if (!mIsTypeAheadOn) { |
Lines 294-300
Link Here
|
294 |
do_GetService(kStringBundleServiceCID); |
294 |
do_GetService(kStringBundleServiceCID); |
295 |
|
295 |
|
296 |
if (stringBundleService) |
296 |
if (stringBundleService) |
297 |
stringBundleService->CreateBundle(TYPEAHEADFIND_BUNDLE_URL, |
297 |
stringBundleService->CreateBundle(TYPEAHEADFINDSEA_BUNDLE_URL, |
298 |
getter_AddRefs(mStringBundle)); |
298 |
getter_AddRefs(mStringBundle)); |
299 |
|
299 |
|
300 |
// Observe find again commands. We'll handle them if we were the last find |
300 |
// Observe find again commands. We'll handle them if we were the last find |
Lines 309-342
Link Here
|
309 |
} |
309 |
} |
310 |
|
310 |
|
311 |
PRBool oldAutoStartPref = mAutoStartPref; |
311 |
PRBool oldAutoStartPref = mAutoStartPref; |
312 |
prefBranch->GetBoolPref("accessibility.typeaheadfind.autostart", |
312 |
prefBranch->GetBoolPref("accessibility.typeaheadfindsea.autostart", |
313 |
&mAutoStartPref); |
313 |
&mAutoStartPref); |
314 |
if (mAutoStartPref != oldAutoStartPref) { |
314 |
if (mAutoStartPref != oldAutoStartPref) { |
315 |
ResetGlobalAutoStart(mAutoStartPref); |
315 |
ResetGlobalAutoStart(mAutoStartPref); |
316 |
} |
316 |
} |
317 |
|
317 |
|
318 |
prefBranch->GetBoolPref("accessibility.typeaheadfind.linksonly", |
318 |
prefBranch->GetBoolPref("accessibility.typeaheadfindsea.linksonly", |
319 |
&mLinksOnlyPref); |
319 |
&mLinksOnlyPref); |
320 |
|
320 |
|
321 |
prefBranch->GetBoolPref("accessibility.typeaheadfind.startlinksonly", |
321 |
prefBranch->GetBoolPref("accessibility.typeaheadfindsea.startlinksonly", |
322 |
&mStartLinksOnlyPref); |
322 |
&mStartLinksOnlyPref); |
323 |
|
323 |
|
324 |
PRBool isSoundEnabled = PR_TRUE; |
324 |
PRBool isSoundEnabled = PR_TRUE; |
325 |
prefBranch->GetBoolPref("accessibility.typeaheadfind.enablesound", |
325 |
prefBranch->GetBoolPref("accessibility.typeaheadfindsea.enablesound", |
326 |
&isSoundEnabled); |
326 |
&isSoundEnabled); |
327 |
nsXPIDLCString soundStr; |
327 |
nsXPIDLCString soundStr; |
328 |
if (isSoundEnabled) { |
328 |
if (isSoundEnabled) { |
329 |
prefBranch->GetCharPref("accessibility.typeaheadfind.soundURL", |
329 |
prefBranch->GetCharPref("accessibility.typeaheadfindsea.soundURL", |
330 |
getter_Copies(soundStr)); |
330 |
getter_Copies(soundStr)); |
331 |
} |
331 |
} |
332 |
mNotFoundSoundURL = soundStr; |
332 |
mNotFoundSoundURL = soundStr; |
333 |
|
333 |
|
334 |
PRBool isTimeoutEnabled; |
334 |
PRBool isTimeoutEnabled; |
335 |
prefBranch->GetBoolPref("accessibility.typeaheadfind.enabletimeout", |
335 |
prefBranch->GetBoolPref("accessibility.typeaheadfindsea.enabletimeout", |
336 |
&isTimeoutEnabled); |
336 |
&isTimeoutEnabled); |
337 |
PRInt32 timeoutLength = 0; |
337 |
PRInt32 timeoutLength = 0; |
338 |
if (isTimeoutEnabled) { |
338 |
if (isTimeoutEnabled) { |
339 |
prefBranch->GetIntPref("accessibility.typeaheadfind.timeout", |
339 |
prefBranch->GetIntPref("accessibility.typeaheadfindsea.timeout", |
340 |
&timeoutLength); |
340 |
&timeoutLength); |
341 |
} |
341 |
} |
342 |
mTimeoutLength = timeoutLength; |
342 |
mTimeoutLength = timeoutLength; |
Lines 352-358
Link Here
|
352 |
// ------- nsITimer Methods (1) --------------- |
352 |
// ------- nsITimer Methods (1) --------------- |
353 |
|
353 |
|
354 |
NS_IMETHODIMP |
354 |
NS_IMETHODIMP |
355 |
nsTypeAheadFind::Notify(nsITimer *timer) |
355 |
nsTypeAheadFindSea::Notify(nsITimer *timer) |
356 |
{ |
356 |
{ |
357 |
CancelFind(); |
357 |
CancelFind(); |
358 |
return NS_OK; |
358 |
return NS_OK; |
Lines 361-367
Link Here
|
361 |
// ----------- nsIObserver Methods (1) ------------------- |
361 |
// ----------- nsIObserver Methods (1) ------------------- |
362 |
|
362 |
|
363 |
NS_IMETHODIMP |
363 |
NS_IMETHODIMP |
364 |
nsTypeAheadFind::Observe(nsISupports *aSubject, const char *aTopic, |
364 |
nsTypeAheadFindSea::Observe(nsISupports *aSubject, const char *aTopic, |
365 |
const PRUnichar *aData) |
365 |
const PRUnichar *aData) |
366 |
{ |
366 |
{ |
367 |
PRBool isOpening; |
367 |
PRBool isOpening; |
Lines 475-481
Link Here
|
475 |
|
475 |
|
476 |
|
476 |
|
477 |
nsresult |
477 |
nsresult |
478 |
nsTypeAheadFind::UseInWindow(nsIDOMWindow *aDOMWin) |
478 |
nsTypeAheadFindSea::UseInWindow(nsIDOMWindow *aDOMWin) |
479 |
{ |
479 |
{ |
480 |
NS_ENSURE_ARG_POINTER(aDOMWin); |
480 |
NS_ENSURE_ARG_POINTER(aDOMWin); |
481 |
|
481 |
|
Lines 528-534
Link Here
|
528 |
// ------- nsIDOMEventListener Methods (1) --------------- |
528 |
// ------- nsIDOMEventListener Methods (1) --------------- |
529 |
|
529 |
|
530 |
NS_IMETHODIMP |
530 |
NS_IMETHODIMP |
531 |
nsTypeAheadFind::HandleEvent(nsIDOMEvent* aEvent) |
531 |
nsTypeAheadFindSea::HandleEvent(nsIDOMEvent* aEvent) |
532 |
{ |
532 |
{ |
533 |
nsAutoString eventType; |
533 |
nsAutoString eventType; |
534 |
aEvent->GetType(eventType); |
534 |
aEvent->GetType(eventType); |
Lines 588-608
Link Here
|
588 |
// ------- nsIDOMKeyListener Methods (3) --------------- |
588 |
// ------- nsIDOMKeyListener Methods (3) --------------- |
589 |
|
589 |
|
590 |
NS_IMETHODIMP |
590 |
NS_IMETHODIMP |
591 |
nsTypeAheadFind::KeyDown(nsIDOMEvent* aEvent) |
591 |
nsTypeAheadFindSea::KeyDown(nsIDOMEvent* aEvent) |
592 |
{ |
592 |
{ |
593 |
return NS_OK; |
593 |
return NS_OK; |
594 |
} |
594 |
} |
595 |
|
595 |
|
596 |
|
596 |
|
597 |
NS_IMETHODIMP |
597 |
NS_IMETHODIMP |
598 |
nsTypeAheadFind::KeyUp(nsIDOMEvent* aEvent) |
598 |
nsTypeAheadFindSea::KeyUp(nsIDOMEvent* aEvent) |
599 |
{ |
599 |
{ |
600 |
return NS_OK; |
600 |
return NS_OK; |
601 |
} |
601 |
} |
602 |
|
602 |
|
603 |
|
603 |
|
604 |
NS_IMETHODIMP |
604 |
NS_IMETHODIMP |
605 |
nsTypeAheadFind::KeyPress(nsIDOMEvent* aEvent) |
605 |
nsTypeAheadFindSea::KeyPress(nsIDOMEvent* aEvent) |
606 |
{ |
606 |
{ |
607 |
if (!mIsTypeAheadOn || mIsMenuBarActive || mIsMenuPopupActive) { |
607 |
if (!mIsTypeAheadOn || mIsMenuBarActive || mIsMenuPopupActive) { |
608 |
return NS_OK; |
608 |
return NS_OK; |
Lines 732-738
Link Here
|
732 |
|
732 |
|
733 |
|
733 |
|
734 |
NS_IMETHODIMP |
734 |
NS_IMETHODIMP |
735 |
nsTypeAheadFind::BackOneChar(PRBool *aIsBackspaceUsed) |
735 |
nsTypeAheadFindSea::BackOneChar(PRBool *aIsBackspaceUsed) |
736 |
{ |
736 |
{ |
737 |
if (!mFocusedDocSelection) { |
737 |
if (!mFocusedDocSelection) { |
738 |
*aIsBackspaceUsed = PR_FALSE; |
738 |
*aIsBackspaceUsed = PR_FALSE; |
Lines 862-868
Link Here
|
862 |
|
862 |
|
863 |
|
863 |
|
864 |
nsresult |
864 |
nsresult |
865 |
nsTypeAheadFind::HandleChar(PRUnichar aChar) |
865 |
nsTypeAheadFindSea::HandleChar(PRUnichar aChar) |
866 |
{ |
866 |
{ |
867 |
// Add a printable char to mTypeAheadBuffer, then search for buffer contents |
867 |
// Add a printable char to mTypeAheadBuffer, then search for buffer contents |
868 |
|
868 |
|
Lines 1027-1033
Link Here
|
1027 |
|
1027 |
|
1028 |
|
1028 |
|
1029 |
void |
1029 |
void |
1030 |
nsTypeAheadFind::SaveFind() |
1030 |
nsTypeAheadFindSea::SaveFind() |
1031 |
{ |
1031 |
{ |
1032 |
// Store find string for find-next |
1032 |
// Store find string for find-next |
1033 |
mFindNextBuffer = mTypeAheadBuffer; |
1033 |
mFindNextBuffer = mTypeAheadBuffer; |
Lines 1048-1061
Link Here
|
1048 |
mFindService->SetSearchString(mFindNextBuffer); |
1048 |
mFindService->SetSearchString(mFindNextBuffer); |
1049 |
} |
1049 |
} |
1050 |
|
1050 |
|
1051 |
// --- If accessibility.typeaheadfind.timeout is set, |
1051 |
// --- If accessibility.typeaheadfindsea.timeout is set, |
1052 |
// cancel find after specified # milliseconds --- |
1052 |
// cancel find after specified # milliseconds --- |
1053 |
StartTimeout(); |
1053 |
StartTimeout(); |
1054 |
} |
1054 |
} |
1055 |
|
1055 |
|
1056 |
|
1056 |
|
1057 |
void |
1057 |
void |
1058 |
nsTypeAheadFind::PlayNotFoundSound() |
1058 |
nsTypeAheadFindSea::PlayNotFoundSound() |
1059 |
{ |
1059 |
{ |
1060 |
if (mNotFoundSoundURL.IsEmpty()) // no sound |
1060 |
if (mNotFoundSoundURL.IsEmpty()) // no sound |
1061 |
return; |
1061 |
return; |
Lines 1085-1091
Link Here
|
1085 |
|
1085 |
|
1086 |
|
1086 |
|
1087 |
NS_IMETHODIMP |
1087 |
NS_IMETHODIMP |
1088 |
nsTypeAheadFind::HandleText(nsIDOMEvent* aTextEvent) |
1088 |
nsTypeAheadFindSea::HandleText(nsIDOMEvent* aTextEvent) |
1089 |
{ |
1089 |
{ |
1090 |
// This is called multiple times in the middle of an |
1090 |
// This is called multiple times in the middle of an |
1091 |
// IME composition |
1091 |
// IME composition |
Lines 1133-1139
Link Here
|
1133 |
|
1133 |
|
1134 |
|
1134 |
|
1135 |
NS_IMETHODIMP |
1135 |
NS_IMETHODIMP |
1136 |
nsTypeAheadFind::HandleStartComposition(nsIDOMEvent* aCompositionEvent) |
1136 |
nsTypeAheadFindSea::HandleStartComposition(nsIDOMEvent* aCompositionEvent) |
1137 |
{ |
1137 |
{ |
1138 |
// This is called once at the start of an IME composition |
1138 |
// This is called once at the start of an IME composition |
1139 |
|
1139 |
|
Lines 1155-1161
Link Here
|
1155 |
|
1155 |
|
1156 |
|
1156 |
|
1157 |
NS_IMETHODIMP |
1157 |
NS_IMETHODIMP |
1158 |
nsTypeAheadFind::HandleEndComposition(nsIDOMEvent* aCompositionEvent) |
1158 |
nsTypeAheadFindSea::HandleEndComposition(nsIDOMEvent* aCompositionEvent) |
1159 |
{ |
1159 |
{ |
1160 |
// This is called once at the end of an IME composition |
1160 |
// This is called once at the end of an IME composition |
1161 |
|
1161 |
|
Lines 1186-1206
Link Here
|
1186 |
|
1186 |
|
1187 |
|
1187 |
|
1188 |
NS_IMETHODIMP |
1188 |
NS_IMETHODIMP |
1189 |
nsTypeAheadFind::HandleQueryComposition(nsIDOMEvent* aCompositionEvent) |
1189 |
nsTypeAheadFindSea::HandleQueryComposition(nsIDOMEvent* aCompositionEvent) |
1190 |
{ |
1190 |
{ |
1191 |
return NS_OK; |
1191 |
return NS_OK; |
1192 |
} |
1192 |
} |
1193 |
|
1193 |
|
1194 |
|
1194 |
|
1195 |
NS_IMETHODIMP |
1195 |
NS_IMETHODIMP |
1196 |
nsTypeAheadFind::HandleQueryReconversion(nsIDOMEvent* aCompositionEvent) |
1196 |
nsTypeAheadFindSea::HandleQueryReconversion(nsIDOMEvent* aCompositionEvent) |
1197 |
{ |
1197 |
{ |
1198 |
return NS_OK; |
1198 |
return NS_OK; |
1199 |
} |
1199 |
} |
1200 |
|
1200 |
|
1201 |
|
1201 |
|
1202 |
nsresult |
1202 |
nsresult |
1203 |
nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell, |
1203 |
nsTypeAheadFindSea::FindItNow(nsIPresShell *aPresShell, |
1204 |
PRBool aIsRepeatingSameChar, PRBool aIsLinksOnly, |
1204 |
PRBool aIsRepeatingSameChar, PRBool aIsLinksOnly, |
1205 |
PRBool aIsFirstVisiblePreferred) |
1205 |
PRBool aIsFirstVisiblePreferred) |
1206 |
{ |
1206 |
{ |
Lines 1225-1231
Link Here
|
1225 |
|
1225 |
|
1226 |
nsCOMPtr<nsISupports> startingContainer = presContext->GetContainer(); |
1226 |
nsCOMPtr<nsISupports> startingContainer = presContext->GetContainer(); |
1227 |
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(startingContainer)); |
1227 |
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(startingContainer)); |
1228 |
NS_ASSERTION(treeItem, "Bug 175321 Crashes with Type Ahead Find [@ nsTypeAheadFind::FindItNow]"); |
1228 |
NS_ASSERTION(treeItem, "Bug 175321 Crashes with Type Ahead Find [@ nsTypeAheadFindSea::FindItNow]"); |
1229 |
if (!treeItem) { |
1229 |
if (!treeItem) { |
1230 |
return NS_ERROR_FAILURE; |
1230 |
return NS_ERROR_FAILURE; |
1231 |
} |
1231 |
} |
Lines 1450-1456
Link Here
|
1450 |
|
1450 |
|
1451 |
|
1451 |
|
1452 |
nsresult |
1452 |
nsresult |
1453 |
nsTypeAheadFind::GetSearchContainers(nsISupports *aContainer, |
1453 |
nsTypeAheadFindSea::GetSearchContainers(nsISupports *aContainer, |
1454 |
PRBool aIsRepeatingSameChar, |
1454 |
PRBool aIsRepeatingSameChar, |
1455 |
PRBool aIsFirstVisiblePreferred, |
1455 |
PRBool aIsFirstVisiblePreferred, |
1456 |
PRBool aCanUseDocSelection, |
1456 |
PRBool aCanUseDocSelection, |
Lines 1561-1567
Link Here
|
1561 |
|
1561 |
|
1562 |
|
1562 |
|
1563 |
void |
1563 |
void |
1564 |
nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange, |
1564 |
nsTypeAheadFindSea::RangeStartsInsideLink(nsIDOMRange *aRange, |
1565 |
nsIPresShell *aPresShell, |
1565 |
nsIPresShell *aPresShell, |
1566 |
PRBool *aIsInsideLink, |
1566 |
PRBool *aIsInsideLink, |
1567 |
PRBool *aIsStartingLink) |
1567 |
PRBool *aIsStartingLink) |
Lines 1673-1679
Link Here
|
1673 |
|
1673 |
|
1674 |
|
1674 |
|
1675 |
NS_IMETHODIMP |
1675 |
NS_IMETHODIMP |
1676 |
nsTypeAheadFind::ScrollPositionWillChange(nsIScrollableView *aView, |
1676 |
nsTypeAheadFindSea::ScrollPositionWillChange(nsIScrollableView *aView, |
1677 |
nscoord aX, nscoord aY) |
1677 |
nscoord aX, nscoord aY) |
1678 |
{ |
1678 |
{ |
1679 |
return NS_OK; |
1679 |
return NS_OK; |
Lines 1681-1687
Link Here
|
1681 |
|
1681 |
|
1682 |
|
1682 |
|
1683 |
NS_IMETHODIMP |
1683 |
NS_IMETHODIMP |
1684 |
nsTypeAheadFind::ScrollPositionDidChange(nsIScrollableView *aScrollableView, |
1684 |
nsTypeAheadFindSea::ScrollPositionDidChange(nsIScrollableView *aScrollableView, |
1685 |
nscoord aX, nscoord aY) |
1685 |
nscoord aX, nscoord aY) |
1686 |
{ |
1686 |
{ |
1687 |
if (!mIsFindingText) |
1687 |
if (!mIsFindingText) |
Lines 1692-1698
Link Here
|
1692 |
|
1692 |
|
1693 |
|
1693 |
|
1694 |
NS_IMETHODIMP |
1694 |
NS_IMETHODIMP |
1695 |
nsTypeAheadFind::NotifySelectionChanged(nsIDOMDocument *aDoc, |
1695 |
nsTypeAheadFindSea::NotifySelectionChanged(nsIDOMDocument *aDoc, |
1696 |
nsISelection *aSel, short aReason) |
1696 |
nsISelection *aSel, short aReason) |
1697 |
{ |
1697 |
{ |
1698 |
if (!mIsFindingText) { |
1698 |
if (!mIsFindingText) { |
Lines 1709-1718
Link Here
|
1709 |
} |
1709 |
} |
1710 |
|
1710 |
|
1711 |
|
1711 |
|
1712 |
// ---------------- nsITypeAheadFind -------------------- |
1712 |
// ---------------- nsITypeAheadFindSea -------------------- |
1713 |
|
1713 |
|
1714 |
NS_IMETHODIMP |
1714 |
NS_IMETHODIMP |
1715 |
nsTypeAheadFind::FindNext(PRBool aFindBackwards, nsISupportsInterfacePointer *aCallerWindowSupports) |
1715 |
nsTypeAheadFindSea::FindNext(PRBool aFindBackwards, nsISupportsInterfacePointer *aCallerWindowSupports) |
1716 |
{ |
1716 |
{ |
1717 |
NS_ENSURE_TRUE(aCallerWindowSupports, NS_ERROR_FAILURE); |
1717 |
NS_ENSURE_TRUE(aCallerWindowSupports, NS_ERROR_FAILURE); |
1718 |
|
1718 |
|
Lines 1724-1730
Link Here
|
1724 |
return NS_OK; |
1724 |
return NS_OK; |
1725 |
} |
1725 |
} |
1726 |
|
1726 |
|
1727 |
// Compare the top level content pres shell of typeaheadfind |
1727 |
// Compare the top level content pres shell of typeaheadfindsea |
1728 |
// with the top level content pres shell window where find next is happening |
1728 |
// with the top level content pres shell window where find next is happening |
1729 |
// If they're different, exit so that webbrowswerfind can handle FindNext() |
1729 |
// If they're different, exit so that webbrowswerfind can handle FindNext() |
1730 |
|
1730 |
|
Lines 1758-1764
Link Here
|
1758 |
NS_ENSURE_TRUE(callerPresShell, NS_OK); |
1758 |
NS_ENSURE_TRUE(callerPresShell, NS_OK); |
1759 |
|
1759 |
|
1760 |
if (callerPresShell != typeAheadPresShell) { |
1760 |
if (callerPresShell != typeAheadPresShell) { |
1761 |
// This means typeaheadfind is active in a different window or doc |
1761 |
// This means typeaheadfindsea is active in a different window or doc |
1762 |
// So it's not appropriate to find next for the current window |
1762 |
// So it's not appropriate to find next for the current window |
1763 |
mFindNextBuffer.Truncate(); |
1763 |
mFindNextBuffer.Truncate(); |
1764 |
return NS_OK; |
1764 |
return NS_OK; |
Lines 1776-1782
Link Here
|
1776 |
webBrowserFind->GetSearchString(getter_Copies(webBrowserFindString)); |
1776 |
webBrowserFind->GetSearchString(getter_Copies(webBrowserFindString)); |
1777 |
if (!webBrowserFindString.Equals(mFindNextBuffer)) { |
1777 |
if (!webBrowserFindString.Equals(mFindNextBuffer)) { |
1778 |
// If they're not equal, then the find dialog was used last, |
1778 |
// If they're not equal, then the find dialog was used last, |
1779 |
// not typeaheadfind. Typeaheadfind applies to the last find, |
1779 |
// not typeaheadfindsea. Typeaheadfind applies to the last find, |
1780 |
// so we should let nsIWebBrowserFind::FindNext() do it. |
1780 |
// so we should let nsIWebBrowserFind::FindNext() do it. |
1781 |
mFindNextBuffer.Truncate(); |
1781 |
mFindNextBuffer.Truncate(); |
1782 |
return NS_OK; |
1782 |
return NS_OK; |
Lines 1826-1832
Link Here
|
1826 |
|
1826 |
|
1827 |
|
1827 |
|
1828 |
NS_IMETHODIMP |
1828 |
NS_IMETHODIMP |
1829 |
nsTypeAheadFind::GetIsActive(PRBool *aIsActive) |
1829 |
nsTypeAheadFindSea::GetIsActive(PRBool *aIsActive) |
1830 |
{ |
1830 |
{ |
1831 |
*aIsActive = mLinksOnlyManuallySet || !mTypeAheadBuffer.IsEmpty(); |
1831 |
*aIsActive = mLinksOnlyManuallySet || !mTypeAheadBuffer.IsEmpty(); |
1832 |
|
1832 |
|
Lines 1839-1845
Link Here
|
1839 |
*/ |
1839 |
*/ |
1840 |
|
1840 |
|
1841 |
NS_IMETHODIMP |
1841 |
NS_IMETHODIMP |
1842 |
nsTypeAheadFind::StartNewFind(nsIDOMWindow *aWindow, PRBool aLinksOnly) |
1842 |
nsTypeAheadFindSea::StartNewFind(nsIDOMWindow *aWindow, PRBool aLinksOnly) |
1843 |
{ |
1843 |
{ |
1844 |
if (!mFind || !mIsTypeAheadOn || !aWindow) |
1844 |
if (!mFind || !mIsTypeAheadOn || !aWindow) |
1845 |
return NS_ERROR_FAILURE; // Type Ahead Find not correctly initialized |
1845 |
return NS_ERROR_FAILURE; // Type Ahead Find not correctly initialized |
Lines 1872-1878
Link Here
|
1872 |
} |
1872 |
} |
1873 |
|
1873 |
|
1874 |
void |
1874 |
void |
1875 |
nsTypeAheadFind::ResetGlobalAutoStart(PRBool aAutoStart) |
1875 |
nsTypeAheadFindSea::ResetGlobalAutoStart(PRBool aAutoStart) |
1876 |
{ |
1876 |
{ |
1877 |
// Enumerate through the current top level windows |
1877 |
// Enumerate through the current top level windows |
1878 |
// and either attach or remove window listeners |
1878 |
// and either attach or remove window listeners |
Lines 1910-1916
Link Here
|
1910 |
|
1910 |
|
1911 |
|
1911 |
|
1912 |
NS_IMETHODIMP |
1912 |
NS_IMETHODIMP |
1913 |
nsTypeAheadFind::SetAutoStart(nsIDOMWindow *aDOMWin, PRBool aAutoStartOn) |
1913 |
nsTypeAheadFindSea::SetAutoStart(nsIDOMWindow *aDOMWin, PRBool aAutoStartOn) |
1914 |
{ |
1914 |
{ |
1915 |
if (!aDOMWin) { |
1915 |
if (!aDOMWin) { |
1916 |
return NS_ERROR_FAILURE; |
1916 |
return NS_ERROR_FAILURE; |
Lines 1940-1946
Link Here
|
1940 |
|
1940 |
|
1941 |
|
1941 |
|
1942 |
NS_IMETHODIMP |
1942 |
NS_IMETHODIMP |
1943 |
nsTypeAheadFind::GetAutoStart(nsIDOMWindow *aDOMWin, PRBool *aIsAutoStartOn) |
1943 |
nsTypeAheadFindSea::GetAutoStart(nsIDOMWindow *aDOMWin, PRBool *aIsAutoStartOn) |
1944 |
{ |
1944 |
{ |
1945 |
*aIsAutoStartOn = PR_FALSE; |
1945 |
*aIsAutoStartOn = PR_FALSE; |
1946 |
|
1946 |
|
Lines 2008-2014
Link Here
|
2008 |
|
2008 |
|
2009 |
|
2009 |
|
2010 |
NS_IMETHODIMP |
2010 |
NS_IMETHODIMP |
2011 |
nsTypeAheadFind::CancelFind() |
2011 |
nsTypeAheadFindSea::CancelFind() |
2012 |
{ |
2012 |
{ |
2013 |
// Stop current find if: |
2013 |
// Stop current find if: |
2014 |
// 1. Escape pressed |
2014 |
// 1. Escape pressed |
Lines 2065-2071
Link Here
|
2065 |
// ------- Helper Methods --------------- |
2065 |
// ------- Helper Methods --------------- |
2066 |
|
2066 |
|
2067 |
void |
2067 |
void |
2068 |
nsTypeAheadFind::GetTopContentPresShell(nsIDocShellTreeItem *aDocShellTreeItem, |
2068 |
nsTypeAheadFindSea::GetTopContentPresShell(nsIDocShellTreeItem *aDocShellTreeItem, |
2069 |
nsIPresShell **aPresShell) |
2069 |
nsIPresShell **aPresShell) |
2070 |
{ |
2070 |
{ |
2071 |
*aPresShell = nsnull; |
2071 |
*aPresShell = nsnull; |
Lines 2081-2087
Link Here
|
2081 |
} |
2081 |
} |
2082 |
|
2082 |
|
2083 |
void |
2083 |
void |
2084 |
nsTypeAheadFind::GetStartWindow(nsIDOMWindow *aWindow, nsIDOMWindow **aStartWindow) |
2084 |
nsTypeAheadFindSea::GetStartWindow(nsIDOMWindow *aWindow, nsIDOMWindow **aStartWindow) |
2085 |
{ |
2085 |
{ |
2086 |
// Return the root ancestor content window of aWindow |
2086 |
// Return the root ancestor content window of aWindow |
2087 |
|
2087 |
|
Lines 2113-2119
Link Here
|
2113 |
} |
2113 |
} |
2114 |
|
2114 |
|
2115 |
nsresult |
2115 |
nsresult |
2116 |
nsTypeAheadFind::GetWebBrowserFind(nsIDOMWindow *aWin, |
2116 |
nsTypeAheadFindSea::GetWebBrowserFind(nsIDOMWindow *aWin, |
2117 |
nsIWebBrowserFind **aWebBrowserFind) |
2117 |
nsIWebBrowserFind **aWebBrowserFind) |
2118 |
{ |
2118 |
{ |
2119 |
NS_ENSURE_ARG_POINTER(aWin); |
2119 |
NS_ENSURE_ARG_POINTER(aWin); |
Lines 2138-2144
Link Here
|
2138 |
|
2138 |
|
2139 |
|
2139 |
|
2140 |
void |
2140 |
void |
2141 |
nsTypeAheadFind::StartTimeout() |
2141 |
nsTypeAheadFindSea::StartTimeout() |
2142 |
{ |
2142 |
{ |
2143 |
if (mTimeoutLength) { |
2143 |
if (mTimeoutLength) { |
2144 |
if (!mTimer) { |
2144 |
if (!mTimer) { |
Lines 2154-2160
Link Here
|
2154 |
} |
2154 |
} |
2155 |
|
2155 |
|
2156 |
void |
2156 |
void |
2157 |
nsTypeAheadFind::SetSelectionLook(nsIPresShell *aPresShell, |
2157 |
nsTypeAheadFindSea::SetSelectionLook(nsIPresShell *aPresShell, |
2158 |
PRBool aChangeColor, |
2158 |
PRBool aChangeColor, |
2159 |
PRBool aEnabled) |
2159 |
PRBool aEnabled) |
2160 |
{ |
2160 |
{ |
Lines 2162-2169
Link Here
|
2162 |
return; |
2162 |
return; |
2163 |
|
2163 |
|
2164 |
// Show caret when type ahead find is on |
2164 |
// Show caret when type ahead find is on |
2165 |
// Also paint selection bright (typeaheadfind on) or normal |
2165 |
// Also paint selection bright (typeaheadfindsea on) or normal |
2166 |
// (typeaheadfind off) |
2166 |
// (typeaheadfindsea off) |
2167 |
|
2167 |
|
2168 |
if (aChangeColor) { |
2168 |
if (aChangeColor) { |
2169 |
mFocusedDocSelCon->SetDisplaySelection(nsISelectionController::SELECTION_ATTENTION); |
2169 |
mFocusedDocSelCon->SetDisplaySelection(nsISelectionController::SELECTION_ATTENTION); |
Lines 2210-2216
Link Here
|
2210 |
|
2210 |
|
2211 |
|
2211 |
|
2212 |
void |
2212 |
void |
2213 |
nsTypeAheadFind::RemoveDocListeners() |
2213 |
nsTypeAheadFindSea::RemoveDocListeners() |
2214 |
{ |
2214 |
{ |
2215 |
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mFocusedWeakShell)); |
2215 |
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mFocusedWeakShell)); |
2216 |
nsIViewManager* vm = nsnull; |
2216 |
nsIViewManager* vm = nsnull; |
Lines 2244-2250
Link Here
|
2244 |
|
2244 |
|
2245 |
|
2245 |
|
2246 |
void |
2246 |
void |
2247 |
nsTypeAheadFind::AttachDocListeners(nsIPresShell *aPresShell) |
2247 |
nsTypeAheadFindSea::AttachDocListeners(nsIPresShell *aPresShell) |
2248 |
{ |
2248 |
{ |
2249 |
if (!aPresShell) { |
2249 |
if (!aPresShell) { |
2250 |
return; |
2250 |
return; |
Lines 2274-2280
Link Here
|
2274 |
|
2274 |
|
2275 |
|
2275 |
|
2276 |
void |
2276 |
void |
2277 |
nsTypeAheadFind::RemoveWindowListeners(nsIDOMWindow *aDOMWin) |
2277 |
nsTypeAheadFindSea::RemoveWindowListeners(nsIDOMWindow *aDOMWin) |
2278 |
{ |
2278 |
{ |
2279 |
nsCOMPtr<nsIDOMEventTarget> chromeEventHandler; |
2279 |
nsCOMPtr<nsIDOMEventTarget> chromeEventHandler; |
2280 |
GetChromeEventHandler(aDOMWin, getter_AddRefs(chromeEventHandler)); |
2280 |
GetChromeEventHandler(aDOMWin, getter_AddRefs(chromeEventHandler)); |
Lines 2331-2337
Link Here
|
2331 |
|
2331 |
|
2332 |
|
2332 |
|
2333 |
void |
2333 |
void |
2334 |
nsTypeAheadFind::AttachWindowListeners(nsIDOMWindow *aDOMWin) |
2334 |
nsTypeAheadFindSea::AttachWindowListeners(nsIDOMWindow *aDOMWin) |
2335 |
{ |
2335 |
{ |
2336 |
nsCOMPtr<nsIDOMEventTarget> chromeEventHandler; |
2336 |
nsCOMPtr<nsIDOMEventTarget> chromeEventHandler; |
2337 |
GetChromeEventHandler(aDOMWin, getter_AddRefs(chromeEventHandler)); |
2337 |
GetChromeEventHandler(aDOMWin, getter_AddRefs(chromeEventHandler)); |
Lines 2384-2390
Link Here
|
2384 |
|
2384 |
|
2385 |
|
2385 |
|
2386 |
void |
2386 |
void |
2387 |
nsTypeAheadFind::GetChromeEventHandler(nsIDOMWindow *aDOMWin, |
2387 |
nsTypeAheadFindSea::GetChromeEventHandler(nsIDOMWindow *aDOMWin, |
2388 |
nsIDOMEventTarget **aChromeTarget) |
2388 |
nsIDOMEventTarget **aChromeTarget) |
2389 |
{ |
2389 |
{ |
2390 |
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin)); |
2390 |
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin)); |
Lines 2400-2406
Link Here
|
2400 |
} |
2400 |
} |
2401 |
|
2401 |
|
2402 |
PRBool |
2402 |
PRBool |
2403 |
nsTypeAheadFind::IsTargetContentOkay(nsIContent *aContent) |
2403 |
nsTypeAheadFindSea::IsTargetContentOkay(nsIContent *aContent) |
2404 |
{ |
2404 |
{ |
2405 |
if (!aContent) { |
2405 |
if (!aContent) { |
2406 |
return PR_FALSE; |
2406 |
return PR_FALSE; |
Lines 2438-2444
Link Here
|
2438 |
|
2438 |
|
2439 |
|
2439 |
|
2440 |
nsresult |
2440 |
nsresult |
2441 |
nsTypeAheadFind::GetTargetIfTypeAheadOkay(nsIDOMEvent *aEvent, |
2441 |
nsTypeAheadFindSea::GetTargetIfTypeAheadOkay(nsIDOMEvent *aEvent, |
2442 |
nsIContent **aTargetContent, |
2442 |
nsIContent **aTargetContent, |
2443 |
nsIPresShell **aTargetPresShell) |
2443 |
nsIPresShell **aTargetPresShell) |
2444 |
{ |
2444 |
{ |
Lines 2524-2530
Link Here
|
2524 |
|
2524 |
|
2525 |
|
2525 |
|
2526 |
void |
2526 |
void |
2527 |
nsTypeAheadFind::GetSelection(nsIPresShell *aPresShell, |
2527 |
nsTypeAheadFindSea::GetSelection(nsIPresShell *aPresShell, |
2528 |
nsISelectionController **aSelCon, |
2528 |
nsISelectionController **aSelCon, |
2529 |
nsISelection **aDOMSel) |
2529 |
nsISelection **aDOMSel) |
2530 |
{ |
2530 |
{ |
Lines 2548-2554
Link Here
|
2548 |
|
2548 |
|
2549 |
|
2549 |
|
2550 |
PRBool |
2550 |
PRBool |
2551 |
nsTypeAheadFind::IsRangeVisible(nsIPresShell *aPresShell, |
2551 |
nsTypeAheadFindSea::IsRangeVisible(nsIPresShell *aPresShell, |
2552 |
nsIPresContext *aPresContext, |
2552 |
nsIPresContext *aPresContext, |
2553 |
nsIDOMRange *aRange, PRBool aMustBeInViewPort, |
2553 |
nsIDOMRange *aRange, PRBool aMustBeInViewPort, |
2554 |
PRBool aGetTopVisibleLeaf, |
2554 |
PRBool aGetTopVisibleLeaf, |
Lines 2703-2709
Link Here
|
2703 |
|
2703 |
|
2704 |
|
2704 |
|
2705 |
nsresult |
2705 |
nsresult |
2706 |
nsTypeAheadFind::GetTranslatedString(const nsAString& aKey, |
2706 |
nsTypeAheadFindSea::GetTranslatedString(const nsAString& aKey, |
2707 |
nsAString& aStringOut) |
2707 |
nsAString& aStringOut) |
2708 |
{ |
2708 |
{ |
2709 |
nsXPIDLString xsValue; |
2709 |
nsXPIDLString xsValue; |
Lines 2721-2727
Link Here
|
2721 |
|
2721 |
|
2722 |
|
2722 |
|
2723 |
void |
2723 |
void |
2724 |
nsTypeAheadFind::DisplayStatus(PRBool aSuccess, nsIContent *aFocusedContent, |
2724 |
nsTypeAheadFindSea::DisplayStatus(PRBool aSuccess, nsIContent *aFocusedContent, |
2725 |
PRBool aClearStatus, const PRUnichar *aText) |
2725 |
PRBool aClearStatus, const PRUnichar *aText) |
2726 |
{ |
2726 |
{ |
2727 |
// pres shell -> pres context -> container -> tree item -> |
2727 |
// pres shell -> pres context -> container -> tree item -> |
Lines 2869-2875
Link Here
|
2869 |
// Make sure we're not focused on a text field, listbox |
2869 |
// Make sure we're not focused on a text field, listbox |
2870 |
// or other form control that needs typeahead keystrokes |
2870 |
// or other form control that needs typeahead keystrokes |
2871 |
if (focusedContent) { |
2871 |
if (focusedContent) { |
2872 |
*aResult = nsTypeAheadFind::IsTargetContentOkay(focusedContent); |
2872 |
*aResult = nsTypeAheadFindSea::IsTargetContentOkay(focusedContent); |
2873 |
return NS_OK; |
2873 |
return NS_OK; |
2874 |
} |
2874 |
} |
2875 |
|
2875 |
|
Lines 2934-2941
Link Here
|
2934 |
EnsureContentWindow(domWinInternal, getter_AddRefs(startContentWin)); |
2934 |
EnsureContentWindow(domWinInternal, getter_AddRefs(startContentWin)); |
2935 |
NS_ENSURE_TRUE(startContentWin, NS_ERROR_FAILURE); |
2935 |
NS_ENSURE_TRUE(startContentWin, NS_ERROR_FAILURE); |
2936 |
|
2936 |
|
2937 |
nsCOMPtr<nsITypeAheadFind> typeAhead = |
2937 |
nsCOMPtr<nsITypeAheadFindSea> typeAhead = |
2938 |
do_GetService(NS_TYPEAHEADFIND_CONTRACTID); |
2938 |
do_GetService(NS_TYPEAHEADFINDSEA_CONTRACTID); |
2939 |
NS_ENSURE_TRUE(typeAhead, NS_ERROR_FAILURE); |
2939 |
NS_ENSURE_TRUE(typeAhead, NS_ERROR_FAILURE); |
2940 |
|
2940 |
|
2941 |
return typeAhead->StartNewFind(startContentWin, isLinkSearch); |
2941 |
return typeAhead->StartNewFind(startContentWin, isLinkSearch); |