| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Converts a AXObjectCache::AXNotification to a WebAXEvent | 115 // Converts a AXObjectCache::AXNotification to a WebAXEvent |
| 116 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) | 116 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) |
| 117 { | 117 { |
| 118 // These enums have the same values; enforced in AssertMatchingEnums.cpp. | 118 // These enums have the same values; enforced in AssertMatchingEnums.cpp. |
| 119 return static_cast<WebAXEvent>(notification); | 119 return static_cast<WebAXEvent>(notification); |
| 120 } | 120 } |
| 121 | 121 |
| 122 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) | 122 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) |
| 123 : m_webView(webView) | 123 : m_webView(webView) |
| 124 , m_cursorOverridden(false) | 124 , m_cursorOverridden(false) |
| 125 , m_didRequestNonEmptyToolTip(false) |
| 125 { | 126 { |
| 126 } | 127 } |
| 127 | 128 |
| 128 ChromeClientImpl::~ChromeClientImpl() | 129 ChromeClientImpl::~ChromeClientImpl() |
| 129 { | 130 { |
| 130 } | 131 } |
| 131 | 132 |
| 132 PassOwnPtrWillBeRawPtr<ChromeClientImpl> ChromeClientImpl::create(WebViewImpl* w
ebView) | 133 PassOwnPtrWillBeRawPtr<ChromeClientImpl> ChromeClientImpl::create(WebViewImpl* w
ebView) |
| 133 { | 134 { |
| 134 return adoptPtrWillBeNoop(new ChromeClientImpl(webView)); | 135 return adoptPtrWillBeNoop(new ChromeClientImpl(webView)); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 url = plugin->plugin()->linkAtPosition(result.roundedPointInInne
rNodeFrame()); | 570 url = plugin->plugin()->linkAtPosition(result.roundedPointInInne
rNodeFrame()); |
| 570 } | 571 } |
| 571 } | 572 } |
| 572 } | 573 } |
| 573 | 574 |
| 574 m_webView->client()->setMouseOverURL(url); | 575 m_webView->client()->setMouseOverURL(url); |
| 575 } | 576 } |
| 576 | 577 |
| 577 void ChromeClientImpl::setToolTip(const String& tooltipText, TextDirection dir) | 578 void ChromeClientImpl::setToolTip(const String& tooltipText, TextDirection dir) |
| 578 { | 579 { |
| 579 if (m_webView->client()) | 580 if (!m_webView->client()) |
| 581 return; |
| 582 if (!tooltipText.isEmpty()) { |
| 580 m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir)
); | 583 m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir)
); |
| 584 m_didRequestNonEmptyToolTip = true; |
| 585 } else if (m_didRequestNonEmptyToolTip) { |
| 586 // WebViewClient::setToolTipText will send an IPC message. We'd like to |
| 587 // reduce the number of setToolTipText calls. |
| 588 m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir)
); |
| 589 m_didRequestNonEmptyToolTip = false; |
| 590 } |
| 581 } | 591 } |
| 582 | 592 |
| 583 void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportDescrip
tion& description) const | 593 void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportDescrip
tion& description) const |
| 584 { | 594 { |
| 585 m_webView->updatePageDefinedViewportConstraints(description); | 595 m_webView->updatePageDefinedViewportConstraints(description); |
| 586 } | 596 } |
| 587 | 597 |
| 588 void ChromeClientImpl::printDelegate(LocalFrame* frame) | 598 void ChromeClientImpl::printDelegate(LocalFrame* frame) |
| 589 { | 599 { |
| 590 if (m_webView->client()) | 600 if (m_webView->client()) |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 if (m_webView->pageImportanceSignals()) | 1019 if (m_webView->pageImportanceSignals()) |
| 1010 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); | 1020 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); |
| 1011 } | 1021 } |
| 1012 | 1022 |
| 1013 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() | 1023 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() |
| 1014 { | 1024 { |
| 1015 return m_webView->scheduler()->createFrameScheduler().release(); | 1025 return m_webView->scheduler()->createFrameScheduler().release(); |
| 1016 } | 1026 } |
| 1017 | 1027 |
| 1018 } // namespace blink | 1028 } // namespace blink |
| OLD | NEW |