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

Side by Side Diff: Source/web/TextFinder.cpp

Issue 719913002: Call reportFindInPageResultToAccessibility from additional code path. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 --m_activeMatchIndexInCurrentFrame; 184 --m_activeMatchIndexInCurrentFrame;
185 185
186 if (m_activeMatchIndexInCurrentFrame + 1 > m_lastMatchCount) 186 if (m_activeMatchIndexInCurrentFrame + 1 > m_lastMatchCount)
187 m_activeMatchIndexInCurrentFrame = 0; 187 m_activeMatchIndexInCurrentFrame = 0;
188 if (m_activeMatchIndexInCurrentFrame == -1) 188 if (m_activeMatchIndexInCurrentFrame == -1)
189 m_activeMatchIndexInCurrentFrame = m_lastMatchCount - 1; 189 m_activeMatchIndexInCurrentFrame = m_lastMatchCount - 1;
190 } 190 }
191 if (selectionRect) { 191 if (selectionRect) {
192 *selectionRect = ownerFrame().frameView()->contentsToWindow(m_active Match->boundingBox()); 192 *selectionRect = ownerFrame().frameView()->contentsToWindow(m_active Match->boundingBox());
193 reportFindInPageSelection(*selectionRect, m_activeMatchIndexInCurren tFrame + 1, identifier); 193 reportFindInPageSelection(*selectionRect, m_activeMatchIndexInCurren tFrame + 1, identifier);
194 reportFindInPageResultToAccessibility(identifier);
195 } 194 }
196 } 195 }
197 196
198 return true; 197 return true;
199 } 198 }
200 199
201 void TextFinder::stopFindingAndClearSelection() 200 void TextFinder::stopFindingAndClearSelection()
202 { 201 {
203 cancelPendingScopingEffort(); 202 cancelPendingScopingEffort();
204 203
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 // Update the UI with the latest findings. 441 // Update the UI with the latest findings.
443 if (ownerFrame().client()) 442 if (ownerFrame().client())
444 ownerFrame().client()->reportFindInPageMatchCount(identifier, m_totalMat chCount, !m_framesScopingCount); 443 ownerFrame().client()->reportFindInPageMatchCount(identifier, m_totalMat chCount, !m_framesScopingCount);
445 } 444 }
446 445
447 void TextFinder::reportFindInPageSelection(const WebRect& selectionRect, int act iveMatchOrdinal, int identifier) 446 void TextFinder::reportFindInPageSelection(const WebRect& selectionRect, int act iveMatchOrdinal, int identifier)
448 { 447 {
449 // Update the UI with the latest selection rect. 448 // Update the UI with the latest selection rect.
450 if (ownerFrame().client()) 449 if (ownerFrame().client())
451 ownerFrame().client()->reportFindInPageSelection(identifier, ordinalOfFi rstMatch() + activeMatchOrdinal, selectionRect); 450 ownerFrame().client()->reportFindInPageSelection(identifier, ordinalOfFi rstMatch() + activeMatchOrdinal, selectionRect);
451
452 // Update accessibility too, so if the user commits to this query
453 // we can move accessibility focus to this result.
454 reportFindInPageResultToAccessibility(identifier);
452 } 455 }
453 456
454 void TextFinder::resetMatchCount() 457 void TextFinder::resetMatchCount()
455 { 458 {
456 if (m_totalMatchCount > 0) 459 if (m_totalMatchCount > 0)
457 ++m_findMatchMarkersVersion; 460 ++m_findMatchMarkersVersion;
458 461
459 m_totalMatchCount = 0; 462 m_totalMatchCount = 0;
460 m_framesScopingCount = 0; 463 m_framesScopingCount = 0;
461 } 464 }
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 { 790 {
788 visitor->trace(m_ownerFrame); 791 visitor->trace(m_ownerFrame);
789 visitor->trace(m_currentActiveMatchFrame); 792 visitor->trace(m_currentActiveMatchFrame);
790 visitor->trace(m_activeMatch); 793 visitor->trace(m_activeMatch);
791 visitor->trace(m_resumeScopingFromRange); 794 visitor->trace(m_resumeScopingFromRange);
792 visitor->trace(m_deferredScopingWork); 795 visitor->trace(m_deferredScopingWork);
793 visitor->trace(m_findMatchesCache); 796 visitor->trace(m_findMatchesCache);
794 } 797 }
795 798
796 } // namespace blink 799 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698