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 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2446 WebFrame* WebViewImpl::mainFrame() | 2446 WebFrame* WebViewImpl::mainFrame() |
2447 { | 2447 { |
2448 return mainFrameImpl(); | 2448 return mainFrameImpl(); |
2449 } | 2449 } |
2450 | 2450 |
2451 WebFrame* WebViewImpl::findFrameByName( | 2451 WebFrame* WebViewImpl::findFrameByName( |
2452 const WebString& name, WebFrame* relativeToFrame) | 2452 const WebString& name, WebFrame* relativeToFrame) |
2453 { | 2453 { |
2454 if (!relativeToFrame) | 2454 if (!relativeToFrame) |
2455 relativeToFrame = mainFrame(); | 2455 relativeToFrame = mainFrame(); |
2456 LocalFrame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); | 2456 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); |
2457 frame = frame->tree().find(name); | 2457 frame = frame->tree().find(name); |
2458 return WebLocalFrameImpl::fromFrame(frame); | 2458 if (!frame->isLocalFrame()) |
2459 return 0; | |
2460 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); | |
dcheng
2014/06/04 18:06:37
Ditto--add a FIXME here. Either this should only d
kenrb
2014/06/04 20:34:47
Done.
| |
2459 } | 2461 } |
2460 | 2462 |
2461 WebFrame* WebViewImpl::focusedFrame() | 2463 WebFrame* WebViewImpl::focusedFrame() |
2462 { | 2464 { |
2463 return WebLocalFrameImpl::fromFrame(toLocalFrame(focusedWebCoreFrame())); | 2465 return WebLocalFrameImpl::fromFrame(toLocalFrame(focusedWebCoreFrame())); |
2464 } | 2466 } |
2465 | 2467 |
2466 void WebViewImpl::setFocusedFrame(WebFrame* frame) | 2468 void WebViewImpl::setFocusedFrame(WebFrame* frame) |
2467 { | 2469 { |
2468 if (!frame) { | 2470 if (!frame) { |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3230 UserGestureIndicator gesture(DefinitelyProcessingNewUserGesture); | 3232 UserGestureIndicator gesture(DefinitelyProcessingNewUserGesture); |
3231 m_page->dragController().performDrag(&dragData); | 3233 m_page->dragController().performDrag(&dragData); |
3232 | 3234 |
3233 m_dragOperation = WebDragOperationNone; | 3235 m_dragOperation = WebDragOperationNone; |
3234 m_currentDragData = nullptr; | 3236 m_currentDragData = nullptr; |
3235 } | 3237 } |
3236 | 3238 |
3237 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) | 3239 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) |
3238 { | 3240 { |
3239 Vector<uint32_t> result; | 3241 Vector<uint32_t> result; |
3240 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t raverseNext()) { | 3242 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) { |
3241 const WillBeHeapVector<DocumentMarker*>& documentMarkers = frame->docume nt()->markers().markers(); | 3243 if (!frame->isLocalFrame()) |
3244 continue; | |
3245 const WillBeHeapVector<DocumentMarker*>& documentMarkers = toLocalFrame( frame)->document()->markers().markers(); | |
3242 for (size_t i = 0; i < documentMarkers.size(); ++i) | 3246 for (size_t i = 0; i < documentMarkers.size(); ++i) |
3243 result.append(documentMarkers[i]->hash()); | 3247 result.append(documentMarkers[i]->hash()); |
3244 } | 3248 } |
3245 markers->assign(result); | 3249 markers->assign(result); |
3246 } | 3250 } |
3247 | 3251 |
3248 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) | 3252 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) |
3249 { | 3253 { |
3250 ASSERT(m_currentDragData); | 3254 ASSERT(m_currentDragData); |
3251 | 3255 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3429 void WebViewImpl::hidePopups() | 3433 void WebViewImpl::hidePopups() |
3430 { | 3434 { |
3431 hideSelectPopup(); | 3435 hideSelectPopup(); |
3432 if (m_pagePopup) | 3436 if (m_pagePopup) |
3433 closePagePopup(m_pagePopup.get()); | 3437 closePagePopup(m_pagePopup.get()); |
3434 } | 3438 } |
3435 | 3439 |
3436 void WebViewImpl::setIsTransparent(bool isTransparent) | 3440 void WebViewImpl::setIsTransparent(bool isTransparent) |
3437 { | 3441 { |
3438 // Set any existing frames to be transparent. | 3442 // Set any existing frames to be transparent. |
3439 LocalFrame* frame = m_page->mainFrame(); | 3443 Frame* frame = m_page->mainFrame(); |
3440 while (frame) { | 3444 while (frame) { |
3441 frame->view()->setTransparent(isTransparent); | 3445 if (frame->isLocalFrame()) |
3446 toLocalFrame(frame)->view()->setTransparent(isTransparent); | |
3442 frame = frame->tree().traverseNext(); | 3447 frame = frame->tree().traverseNext(); |
3443 } | 3448 } |
3444 | 3449 |
3445 // Future frames check this to know whether to be transparent. | 3450 // Future frames check this to know whether to be transparent. |
3446 m_isTransparent = isTransparent; | 3451 m_isTransparent = isTransparent; |
3447 } | 3452 } |
3448 | 3453 |
3449 bool WebViewImpl::isTransparent() const | 3454 bool WebViewImpl::isTransparent() const |
3450 { | 3455 { |
3451 return m_isTransparent; | 3456 return m_isTransparent; |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4055 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); | 4060 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); |
4056 | 4061 |
4057 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4062 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4058 return false; | 4063 return false; |
4059 | 4064 |
4060 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4065 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4061 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4066 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
4062 } | 4067 } |
4063 | 4068 |
4064 } // namespace blink | 4069 } // namespace blink |
OLD | NEW |