| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1636 RefPtr<WebCore::FrameView> view; | 1636 RefPtr<WebCore::FrameView> view; |
| 1637 if (is_main_frame) { | 1637 if (is_main_frame) { |
| 1638 IntSize size = webkit_glue::WebSizeToIntSize(web_view->size()); | 1638 IntSize size = webkit_glue::WebSizeToIntSize(web_view->size()); |
| 1639 view = FrameView::create(frame_, size); | 1639 view = FrameView::create(frame_, size); |
| 1640 } else { | 1640 } else { |
| 1641 view = FrameView::create(frame_); | 1641 view = FrameView::create(frame_); |
| 1642 } | 1642 } |
| 1643 | 1643 |
| 1644 frame_->setView(view); | 1644 frame_->setView(view); |
| 1645 | 1645 |
| 1646 if (web_view->GetIsTransparent()) | 1646 if (web_view->isTransparent()) |
| 1647 view->setTransparent(true); | 1647 view->setTransparent(true); |
| 1648 | 1648 |
| 1649 // TODO(darin): The Mac code has a comment about this possibly being | 1649 // TODO(darin): The Mac code has a comment about this possibly being |
| 1650 // unnecessary. See installInFrame in WebCoreFrameBridge.mm | 1650 // unnecessary. See installInFrame in WebCoreFrameBridge.mm |
| 1651 if (frame_->ownerRenderer()) | 1651 if (frame_->ownerRenderer()) |
| 1652 frame_->ownerRenderer()->setWidget(view.get()); | 1652 frame_->ownerRenderer()->setWidget(view.get()); |
| 1653 | 1653 |
| 1654 if (HTMLFrameOwnerElement* owner = frame_->ownerElement()) { | 1654 if (HTMLFrameOwnerElement* owner = frame_->ownerElement()) { |
| 1655 view->setCanHaveScrollbars( | 1655 view->setCanHaveScrollbars( |
| 1656 owner->scrollingMode() != WebCore::ScrollbarAlwaysOff); | 1656 owner->scrollingMode() != WebCore::ScrollbarAlwaysOff); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1820 | 1820 |
| 1821 void WebFrameImpl::SetMarkerActive(WebCore::Range* range, bool active) { | 1821 void WebFrameImpl::SetMarkerActive(WebCore::Range* range, bool active) { |
| 1822 if (!range) | 1822 if (!range) |
| 1823 return; | 1823 return; |
| 1824 | 1824 |
| 1825 frame()->document()->setMarkersActive(range, active); | 1825 frame()->document()->setMarkersActive(range, active); |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 int WebFrameImpl::OrdinalOfFirstMatchForFrame(WebFrameImpl* frame) const { | 1828 int WebFrameImpl::OrdinalOfFirstMatchForFrame(WebFrameImpl* frame) const { |
| 1829 int ordinal = 0; | 1829 int ordinal = 0; |
| 1830 WebViewImpl* web_view = GetWebViewImpl(); | 1830 WebFrameImpl* main_frame_impl = GetWebViewImpl()->main_frame(); |
| 1831 WebFrameImpl* const main_frame_impl = GetWebViewImpl()->main_frame(); | |
| 1832 // Iterate from the main frame up to (but not including) |frame| and | 1831 // Iterate from the main frame up to (but not including) |frame| and |
| 1833 // add up the number of matches found so far. | 1832 // add up the number of matches found so far. |
| 1834 for (WebFrameImpl* it = main_frame_impl; | 1833 for (WebFrameImpl* it = main_frame_impl; |
| 1835 it != frame; | 1834 it != frame; |
| 1836 it = static_cast<WebFrameImpl*>( | 1835 it = static_cast<WebFrameImpl*>(it->traverseNext(true))) { |
| 1837 web_view->GetNextFrameAfter(it, true))) { | |
| 1838 if (it->last_match_count_ > 0) | 1836 if (it->last_match_count_ > 0) |
| 1839 ordinal += it->last_match_count_; | 1837 ordinal += it->last_match_count_; |
| 1840 } | 1838 } |
| 1841 | 1839 |
| 1842 return ordinal; | 1840 return ordinal; |
| 1843 } | 1841 } |
| 1844 | 1842 |
| 1845 bool WebFrameImpl::ShouldScopeMatches(const string16& search_text) { | 1843 bool WebFrameImpl::ShouldScopeMatches(const string16& search_text) { |
| 1846 // Don't scope if we can't find a frame or if the frame is not visible. | 1844 // Don't scope if we can't find a frame or if the frame is not visible. |
| 1847 // The user may have closed the tab/application, so abort. | 1845 // The user may have closed the tab/application, so abort. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1914 | 1912 |
| 1915 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); | 1913 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); |
| 1916 | 1914 |
| 1917 if (!frame_->loader()->isScheduledLocationChangePending()) { | 1915 if (!frame_->loader()->isScheduledLocationChangePending()) { |
| 1918 frame_->loader()->stopAllLoaders(); | 1916 frame_->loader()->stopAllLoaders(); |
| 1919 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); | 1917 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); |
| 1920 frame_->loader()->write(script_result); | 1918 frame_->loader()->write(script_result); |
| 1921 frame_->loader()->end(); | 1919 frame_->loader()->end(); |
| 1922 } | 1920 } |
| 1923 } | 1921 } |
| OLD | NEW |