Chromium Code Reviews| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(fram e)->frameWidget()) { | 538 if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(fram e)->frameWidget()) { |
| 539 WebLocalFrameImpl::fromFrame(frame)->frameWidget()->scheduleAnimation(); | 539 WebLocalFrameImpl::fromFrame(frame)->frameWidget()->scheduleAnimation(); |
| 540 } else { | 540 } else { |
| 541 // TODO(lfg): We need to keep this for now because we still have some | 541 // TODO(lfg): We need to keep this for now because we still have some |
| 542 // WebViews who don't have a WebViewFrameWidget. This should be | 542 // WebViews who don't have a WebViewFrameWidget. This should be |
| 543 // removed once the WebViewFrameWidget refactor is complete. | 543 // removed once the WebViewFrameWidget refactor is complete. |
| 544 m_webView->scheduleAnimation(); | 544 m_webView->scheduleAnimation(); |
| 545 } | 545 } |
| 546 } | 546 } |
| 547 | 547 |
| 548 IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport) const | 548 IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, const Widget* widget) const |
| 549 { | 549 { |
| 550 WebRect screenRect(rectInViewport); | 550 WebRect screenRect(rectInViewport); |
| 551 | 551 |
| 552 if (m_webView->client()) { | 552 ASSERT(widget->isFrameView()); |
| 553 m_webView->client()->convertViewportToWindow(&screenRect); | 553 const FrameView* view = toFrameView(widget); |
| 554 WebRect windowRect = m_webView->client()->windowRect(); | 554 LocalFrame* frame = view->frame().localFrameRoot(); |
| 555 WebWidgetClient* client = nullptr; | |
| 556 | |
| 557 if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(fram e)->frameWidget()) { | |
| 558 client = toWebFrameWidgetImpl(WebLocalFrameImpl::fromFrame(frame)->frame Widget())->client(); | |
| 559 } else { | |
|
bokan
2016/03/18 19:25:42
Nit: no braces on single line if/else
kenrb
2016/03/18 20:03:19
Done.
| |
| 560 client = m_webView->client(); | |
| 561 } | |
| 562 | |
| 563 if (client) { | |
| 564 client->convertViewportToWindow(&screenRect); | |
| 565 WebRect windowRect = client->windowRect(); | |
| 555 screenRect.x += windowRect.x; | 566 screenRect.x += windowRect.x; |
| 556 screenRect.y += windowRect.y; | 567 screenRect.y += windowRect.y; |
| 557 } | 568 } |
| 558 return screenRect; | 569 return screenRect; |
| 559 } | 570 } |
| 560 | 571 |
| 561 float ChromeClientImpl::windowToViewportScalar(const float scalarValue) const | 572 float ChromeClientImpl::windowToViewportScalar(const float scalarValue) const |
| 562 { | 573 { |
| 563 if (!m_webView->client()) | 574 if (!m_webView->client()) |
| 564 return scalarValue; | 575 return scalarValue; |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1078 if (m_webView->pageImportanceSignals()) | 1089 if (m_webView->pageImportanceSignals()) |
| 1079 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); | 1090 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); |
| 1080 } | 1091 } |
| 1081 | 1092 |
| 1082 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() | 1093 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() |
| 1083 { | 1094 { |
| 1084 return m_webView->scheduler()->createFrameScheduler().release(); | 1095 return m_webView->scheduler()->createFrameScheduler().release(); |
| 1085 } | 1096 } |
| 1086 | 1097 |
| 1087 } // namespace blink | 1098 } // namespace blink |
| OLD | NEW |