OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
655 // If the enumeration can't happen, call the callback with an empty list. | 655 // If the enumeration can't happen, call the callback with an empty list. |
656 if (!client->enumerateChosenDirectory(fileChooser->settings().selectedFiles[ 0], chooserCompletion)) | 656 if (!client->enumerateChosenDirectory(fileChooser->settings().selectedFiles[ 0], chooserCompletion)) |
657 chooserCompletion->didChooseFile(WebVector<WebString>()); | 657 chooserCompletion->didChooseFile(WebVector<WebString>()); |
658 } | 658 } |
659 | 659 |
660 Cursor ChromeClientImpl::lastSetCursorForTesting() const | 660 Cursor ChromeClientImpl::lastSetCursorForTesting() const |
661 { | 661 { |
662 return m_lastSetMouseCursorForTesting; | 662 return m_lastSetMouseCursorForTesting; |
663 } | 663 } |
664 | 664 |
665 void ChromeClientImpl::setCursor(const Cursor& cursor) | 665 void ChromeClientImpl::setCursor(const Cursor& cursor, LocalFrame* localRoot) |
666 { | 666 { |
667 m_lastSetMouseCursorForTesting = cursor; | 667 m_lastSetMouseCursorForTesting = cursor; |
668 setCursor(WebCursorInfo(cursor)); | 668 setCursor(WebCursorInfo(cursor), localRoot); |
669 } | 669 } |
670 | 670 |
671 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor) | 671 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localR oot) |
672 { | 672 { |
673 if (m_cursorOverridden) | 673 if (m_cursorOverridden) |
674 return; | 674 return; |
675 | 675 |
676 #if OS(MACOSX) | 676 #if OS(MACOSX) |
677 // On Mac the mousemove event propagates to both the popup and main window. | 677 // On Mac the mousemove event propagates to both the popup and main window. |
678 // If a popup is open we don't want the main window to change the cursor. | 678 // If a popup is open we don't want the main window to change the cursor. |
679 if (m_webView->hasOpenedPopup()) | 679 if (m_webView->hasOpenedPopup()) |
680 return; | 680 return; |
681 #endif | 681 #endif |
682 if (m_webView->client()) | 682 if (!m_webView->client()) |
683 return; | |
684 // FIXME: For top-level frames we still use the WebView as a WebWidget. This | |
nasko
2015/10/15 17:06:54
Blink now uses // TODO(username): comments.
kenrb
2015/10/15 17:12:55
Done.
| |
685 // special case will be removed when top-level frames get WebFrameWidgets. | |
686 if (localRoot->isMainFrame()) { | |
683 m_webView->client()->didChangeCursor(cursor); | 687 m_webView->client()->didChangeCursor(cursor); |
688 } else { | |
689 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
690 ASSERT(webFrame); | |
691 ASSERT(webFrame->frameWidget()); | |
692 if (toWebFrameWidgetImpl(webFrame->frameWidget())->client()) | |
693 toWebFrameWidgetImpl(webFrame->frameWidget())->client()->didChangeCu rsor(cursor); | |
694 } | |
684 } | 695 } |
685 | 696 |
686 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor) | 697 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor) |
687 { | 698 { |
688 setCursor(cursor); | 699 setCursor(cursor, m_webView->page()->deprecatedLocalMainFrame()); |
689 } | 700 } |
690 | 701 |
691 void ChromeClientImpl::setCursorOverridden(bool overridden) | 702 void ChromeClientImpl::setCursorOverridden(bool overridden) |
692 { | 703 { |
693 m_cursorOverridden = overridden; | 704 m_cursorOverridden = overridden; |
694 } | 705 } |
695 | 706 |
696 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach e::AXNotification notification) | 707 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach e::AXNotification notification) |
697 { | 708 { |
698 // Alert assistive technology about the accessibility object notification. | 709 // Alert assistive technology about the accessibility object notification. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1007 return m_webView->elasticOverscroll(); | 1018 return m_webView->elasticOverscroll(); |
1008 } | 1019 } |
1009 | 1020 |
1010 void ChromeClientImpl::didObserveNonGetFetchFromScript() const | 1021 void ChromeClientImpl::didObserveNonGetFetchFromScript() const |
1011 { | 1022 { |
1012 if (m_webView->pageImportanceSignals()) | 1023 if (m_webView->pageImportanceSignals()) |
1013 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); | 1024 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); |
1014 } | 1025 } |
1015 | 1026 |
1016 } // namespace blink | 1027 } // namespace blink |
OLD | NEW |