| 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 // TODO(kenrb, dcheng): For top-level frames we still use the WebView as |
| 685 // a WebWidget. This special case will be removed when top-level frames |
| 686 // get WebFrameWidgets. |
| 687 if (localRoot->isMainFrame()) { |
| 683 m_webView->client()->didChangeCursor(cursor); | 688 m_webView->client()->didChangeCursor(cursor); |
| 689 } else { |
| 690 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); |
| 691 ASSERT(webFrame); |
| 692 ASSERT(webFrame->frameWidget()); |
| 693 if (toWebFrameWidgetImpl(webFrame->frameWidget())->client()) |
| 694 toWebFrameWidgetImpl(webFrame->frameWidget())->client()->didChangeCu
rsor(cursor); |
| 695 } |
| 684 } | 696 } |
| 685 | 697 |
| 686 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor) | 698 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor) |
| 687 { | 699 { |
| 688 setCursor(cursor); | 700 setCursor(cursor, m_webView->page()->deprecatedLocalMainFrame()); |
| 689 } | 701 } |
| 690 | 702 |
| 691 void ChromeClientImpl::setCursorOverridden(bool overridden) | 703 void ChromeClientImpl::setCursorOverridden(bool overridden) |
| 692 { | 704 { |
| 693 m_cursorOverridden = overridden; | 705 m_cursorOverridden = overridden; |
| 694 } | 706 } |
| 695 | 707 |
| 696 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach
e::AXNotification notification) | 708 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach
e::AXNotification notification) |
| 697 { | 709 { |
| 698 // Alert assistive technology about the accessibility object notification. | 710 // 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(); | 1019 return m_webView->elasticOverscroll(); |
| 1008 } | 1020 } |
| 1009 | 1021 |
| 1010 void ChromeClientImpl::didObserveNonGetFetchFromScript() const | 1022 void ChromeClientImpl::didObserveNonGetFetchFromScript() const |
| 1011 { | 1023 { |
| 1012 if (m_webView->pageImportanceSignals()) | 1024 if (m_webView->pageImportanceSignals()) |
| 1013 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); | 1025 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); |
| 1014 } | 1026 } |
| 1015 | 1027 |
| 1016 } // namespace blink | 1028 } // namespace blink |
| OLD | NEW |