OLD | NEW |
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 2558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2569 if (it->m_lastMatchCount > 0) | 2569 if (it->m_lastMatchCount > 0) |
2570 ordinal += it->m_lastMatchCount; | 2570 ordinal += it->m_lastMatchCount; |
2571 } | 2571 } |
2572 return ordinal; | 2572 return ordinal; |
2573 } | 2573 } |
2574 | 2574 |
2575 bool WebFrameImpl::shouldScopeMatches(const String& searchText) | 2575 bool WebFrameImpl::shouldScopeMatches(const String& searchText) |
2576 { | 2576 { |
2577 // Don't scope if we can't find a frame or a view. | 2577 // Don't scope if we can't find a frame or a view. |
2578 // The user may have closed the tab/application, so abort. | 2578 // The user may have closed the tab/application, so abort. |
2579 if (!frame() || !frame()->view()) | 2579 if (!frame() || !frame()->view() || !hasVisibleContent()) |
2580 return false; | 2580 return false; |
2581 | 2581 |
2582 ASSERT(frame()->document() && frame()->view()); | 2582 ASSERT(frame()->document() && frame()->view()); |
2583 | 2583 |
2584 // If the frame completed the scoping operation and found 0 matches the last | 2584 // If the frame completed the scoping operation and found 0 matches the last |
2585 // time it was searched, then we don't have to search it again if the user i
s | 2585 // time it was searched, then we don't have to search it again if the user i
s |
2586 // just adding to the search string or sending the same search string again. | 2586 // just adding to the search string or sending the same search string again. |
2587 if (m_lastFindRequestCompletedWithNoMatches && !m_lastSearchString.isEmpty()
) { | 2587 if (m_lastFindRequestCompletedWithNoMatches && !m_lastSearchString.isEmpty()
) { |
2588 // Check to see if the search string prefixes match. | 2588 // Check to see if the search string prefixes match. |
2589 String previousSearchPrefix = | 2589 String previousSearchPrefix = |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2658 | 2658 |
2659 String scriptResult; | 2659 String scriptResult; |
2660 if (!result.getString(scriptResult)) | 2660 if (!result.getString(scriptResult)) |
2661 return; | 2661 return; |
2662 | 2662 |
2663 if (!m_frame->navigationScheduler()->locationChangePending()) | 2663 if (!m_frame->navigationScheduler()->locationChangePending()) |
2664 m_frame->document()->loader()->writer()->replaceDocument(scriptResult, o
wnerDocument.get()); | 2664 m_frame->document()->loader()->writer()->replaceDocument(scriptResult, o
wnerDocument.get()); |
2665 } | 2665 } |
2666 | 2666 |
2667 } // namespace WebKit | 2667 } // namespace WebKit |
OLD | NEW |