| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 } | 2481 } |
| 2482 | 2482 |
| 2483 WebFrame* WebViewImpl::mainFrame() | 2483 WebFrame* WebViewImpl::mainFrame() |
| 2484 { | 2484 { |
| 2485 return mainFrameImpl(); | 2485 return mainFrameImpl(); |
| 2486 } | 2486 } |
| 2487 | 2487 |
| 2488 WebFrame* WebViewImpl::findFrameByName( | 2488 WebFrame* WebViewImpl::findFrameByName( |
| 2489 const WebString& name, WebFrame* relativeToFrame) | 2489 const WebString& name, WebFrame* relativeToFrame) |
| 2490 { | 2490 { |
| 2491 // FIXME: Either this should only deal with WebLocalFrames or it should move
to WebFrame. |
| 2491 if (!relativeToFrame) | 2492 if (!relativeToFrame) |
| 2492 relativeToFrame = mainFrame(); | 2493 relativeToFrame = mainFrame(); |
| 2493 LocalFrame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); | 2494 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); |
| 2494 frame = frame->tree().find(name); | 2495 frame = frame->tree().find(name); |
| 2495 return WebLocalFrameImpl::fromFrame(frame); | 2496 if (!frame->isLocalFrame()) |
| 2497 return 0; |
| 2498 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); |
| 2496 } | 2499 } |
| 2497 | 2500 |
| 2498 WebFrame* WebViewImpl::focusedFrame() | 2501 WebFrame* WebViewImpl::focusedFrame() |
| 2499 { | 2502 { |
| 2500 return WebLocalFrameImpl::fromFrame(toLocalFrame(focusedWebCoreFrame())); | 2503 return WebLocalFrameImpl::fromFrame(toLocalFrame(focusedWebCoreFrame())); |
| 2501 } | 2504 } |
| 2502 | 2505 |
| 2503 void WebViewImpl::setFocusedFrame(WebFrame* frame) | 2506 void WebViewImpl::setFocusedFrame(WebFrame* frame) |
| 2504 { | 2507 { |
| 2505 if (!frame) { | 2508 if (!frame) { |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3273 UserGestureIndicator gesture(DefinitelyProcessingNewUserGesture); | 3276 UserGestureIndicator gesture(DefinitelyProcessingNewUserGesture); |
| 3274 m_page->dragController().performDrag(&dragData); | 3277 m_page->dragController().performDrag(&dragData); |
| 3275 | 3278 |
| 3276 m_dragOperation = WebDragOperationNone; | 3279 m_dragOperation = WebDragOperationNone; |
| 3277 m_currentDragData = nullptr; | 3280 m_currentDragData = nullptr; |
| 3278 } | 3281 } |
| 3279 | 3282 |
| 3280 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) | 3283 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) |
| 3281 { | 3284 { |
| 3282 Vector<uint32_t> result; | 3285 Vector<uint32_t> result; |
| 3283 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t
raverseNext()) { | 3286 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { |
| 3284 const WillBeHeapVector<DocumentMarker*>& documentMarkers = frame->docume
nt()->markers().markers(); | 3287 if (!frame->isLocalFrame()) |
| 3288 continue; |
| 3289 const WillBeHeapVector<DocumentMarker*>& documentMarkers = toLocalFrame(
frame)->document()->markers().markers(); |
| 3285 for (size_t i = 0; i < documentMarkers.size(); ++i) | 3290 for (size_t i = 0; i < documentMarkers.size(); ++i) |
| 3286 result.append(documentMarkers[i]->hash()); | 3291 result.append(documentMarkers[i]->hash()); |
| 3287 } | 3292 } |
| 3288 markers->assign(result); | 3293 markers->assign(result); |
| 3289 } | 3294 } |
| 3290 | 3295 |
| 3291 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo
int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) | 3296 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo
int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) |
| 3292 { | 3297 { |
| 3293 ASSERT(m_currentDragData); | 3298 ASSERT(m_currentDragData); |
| 3294 | 3299 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3472 void WebViewImpl::hidePopups() | 3477 void WebViewImpl::hidePopups() |
| 3473 { | 3478 { |
| 3474 hideSelectPopup(); | 3479 hideSelectPopup(); |
| 3475 if (m_pagePopup) | 3480 if (m_pagePopup) |
| 3476 closePagePopup(m_pagePopup.get()); | 3481 closePagePopup(m_pagePopup.get()); |
| 3477 } | 3482 } |
| 3478 | 3483 |
| 3479 void WebViewImpl::setIsTransparent(bool isTransparent) | 3484 void WebViewImpl::setIsTransparent(bool isTransparent) |
| 3480 { | 3485 { |
| 3481 // Set any existing frames to be transparent. | 3486 // Set any existing frames to be transparent. |
| 3482 LocalFrame* frame = m_page->mainFrame(); | 3487 Frame* frame = m_page->mainFrame(); |
| 3483 while (frame) { | 3488 while (frame) { |
| 3484 frame->view()->setTransparent(isTransparent); | 3489 if (frame->isLocalFrame()) |
| 3490 toLocalFrame(frame)->view()->setTransparent(isTransparent); |
| 3485 frame = frame->tree().traverseNext(); | 3491 frame = frame->tree().traverseNext(); |
| 3486 } | 3492 } |
| 3487 | 3493 |
| 3488 // Future frames check this to know whether to be transparent. | 3494 // Future frames check this to know whether to be transparent. |
| 3489 m_isTransparent = isTransparent; | 3495 m_isTransparent = isTransparent; |
| 3490 } | 3496 } |
| 3491 | 3497 |
| 3492 bool WebViewImpl::isTransparent() const | 3498 bool WebViewImpl::isTransparent() const |
| 3493 { | 3499 { |
| 3494 return m_isTransparent; | 3500 return m_isTransparent; |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4101 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4107 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4102 | 4108 |
| 4103 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4109 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4104 return false; | 4110 return false; |
| 4105 | 4111 |
| 4106 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4112 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4107 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4113 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4108 } | 4114 } |
| 4109 | 4115 |
| 4110 } // namespace blink | 4116 } // namespace blink |
| OLD | NEW |