| 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 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1829 // Finally clear the active match, for two reasons: | 1829 // Finally clear the active match, for two reasons: |
| 1830 // We just finished the find 'session' and we don't want future (potenti
ally | 1830 // We just finished the find 'session' and we don't want future (potenti
ally |
| 1831 // unrelated) find 'sessions' operations to start at the same place. | 1831 // unrelated) find 'sessions' operations to start at the same place. |
| 1832 // The WebLocalFrameImpl could get reused and the activeMatch could end
up pointing | 1832 // The WebLocalFrameImpl could get reused and the activeMatch could end
up pointing |
| 1833 // to a document that is no longer valid. Keeping an invalid reference a
round | 1833 // to a document that is no longer valid. Keeping an invalid reference a
round |
| 1834 // is just asking for trouble. | 1834 // is just asking for trouble. |
| 1835 m_textFinder->resetActiveMatch(); | 1835 m_textFinder->resetActiveMatch(); |
| 1836 } | 1836 } |
| 1837 } | 1837 } |
| 1838 | 1838 |
| 1839 bool WebLocalFrameImpl::setCaretSelectionFromRangeSelection() |
| 1840 { |
| 1841 if (!frame()->selection().rootEditableElement() || !frame()->selection().isR
ange()) |
| 1842 return false; |
| 1843 |
| 1844 // Collapse the selection to end of Range Selection. |
| 1845 WebRange currentSelectionRange = selectionRange(); |
| 1846 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran
ge> >(currentSelectionRange)) { |
| 1847 range->collapse(false); |
| 1848 selectRange(currentSelectionRange); |
| 1849 return true; |
| 1850 } |
| 1851 |
| 1852 return false; |
| 1853 } |
| 1854 |
| 1839 void WebLocalFrameImpl::didFail(const ResourceError& error, bool wasProvisional) | 1855 void WebLocalFrameImpl::didFail(const ResourceError& error, bool wasProvisional) |
| 1840 { | 1856 { |
| 1841 if (!client()) | 1857 if (!client()) |
| 1842 return; | 1858 return; |
| 1843 WebURLError webError = error; | 1859 WebURLError webError = error; |
| 1844 if (wasProvisional) | 1860 if (wasProvisional) |
| 1845 client()->didFailProvisionalLoad(this, webError); | 1861 client()->didFailProvisionalLoad(this, webError); |
| 1846 else | 1862 else |
| 1847 client()->didFailLoad(this, webError); | 1863 client()->didFailLoad(this, webError); |
| 1848 } | 1864 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 { | 1966 { |
| 1951 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host
, owner); | 1967 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host
, owner); |
| 1952 setWebCoreFrame(frame); | 1968 setWebCoreFrame(frame); |
| 1953 frame->tree().setName(name, fallbackName); | 1969 frame->tree().setName(name, fallbackName); |
| 1954 // May dispatch JS events; frame may be detached after this. | 1970 // May dispatch JS events; frame may be detached after this. |
| 1955 frame->init(); | 1971 frame->init(); |
| 1956 return frame; | 1972 return frame; |
| 1957 } | 1973 } |
| 1958 | 1974 |
| 1959 } // namespace blink | 1975 } // namespace blink |
| OLD | NEW |