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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 558 } | 558 } |
| 559 } | 559 } |
| 560 | 560 |
| 561 IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, const Widget* widget) const | 561 IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, const Widget* widget) const |
| 562 { | 562 { |
| 563 WebRect screenRect(rectInViewport); | 563 WebRect screenRect(rectInViewport); |
| 564 | 564 |
| 565 DCHECK(widget->isFrameView()); | 565 DCHECK(widget->isFrameView()); |
| 566 const FrameView* view = toFrameView(widget); | 566 const FrameView* view = toFrameView(widget); |
| 567 LocalFrame* frame = view->frame().localFrameRoot(); | 567 LocalFrame* frame = view->frame().localFrameRoot(); |
| 568 WebWidgetClient* client = nullptr; | |
| 569 | 568 |
| 570 // TODO(kenrb): Consolidate this to a single case when WebViewFrameWidget re factor is complete. | 569 // TODO(kenrb): Consolidate this to a single case when WebViewFrameWidget re factor is complete. |
| 571 if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(fram e)->frameWidget() && WebLocalFrameImpl::fromFrame(frame)->frameWidget()->forSubf rame()) | 570 if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(fram e)->frameWidget() && WebLocalFrameImpl::fromFrame(frame)->frameWidget()->forSubf rame()) { |
|
dcheng
2016/04/27 23:55:04
I previously tried to remove this and failed, beca
lfg
2016/04/28 17:04:33
I removed the branch but had to add a virtual to W
| |
| 572 client = toWebFrameWidgetImpl(WebLocalFrameImpl::fromFrame(frame)->frame Widget())->client(); | 571 WebWidgetClient* client = toWebFrameWidgetImpl(WebLocalFrameImpl::fromFr ame(frame)->frameWidget())->client(); |
| 573 else | |
| 574 client = m_webView->client(); | |
| 575 | 572 |
| 576 if (client) { | 573 if (client) { |
| 577 client->convertViewportToWindow(&screenRect); | 574 client->convertViewportToWindow(&screenRect); |
| 578 WebRect windowRect = client->windowRect(); | 575 WebRect windowRect = client->windowRect(); |
| 579 screenRect.x += windowRect.x; | 576 screenRect.x += windowRect.x; |
| 580 screenRect.y += windowRect.y; | 577 screenRect.y += windowRect.y; |
| 578 } | |
| 579 } else { | |
| 580 WebViewClient* client = m_webView->client(); | |
| 581 | |
| 582 if (client) { | |
| 583 client->convertViewportToWindow(&screenRect); | |
| 584 WebRect windowRect = client->windowRect(); | |
| 585 screenRect.x += windowRect.x; | |
| 586 screenRect.y += windowRect.y; | |
| 587 } | |
| 581 } | 588 } |
| 589 | |
| 582 return screenRect; | 590 return screenRect; |
| 583 } | 591 } |
| 584 | 592 |
| 585 float ChromeClientImpl::windowToViewportScalar(const float scalarValue) const | 593 float ChromeClientImpl::windowToViewportScalar(const float scalarValue) const |
| 586 { | 594 { |
| 587 if (!m_webView->client()) | 595 if (!m_webView->client()) |
| 588 return scalarValue; | 596 return scalarValue; |
| 589 WebFloatRect viewportRect(0, 0, scalarValue, 0); | 597 WebFloatRect viewportRect(0, 0, scalarValue, 0); |
| 590 m_webView->client()->convertWindowToViewport(&viewportRect); | 598 m_webView->client()->convertWindowToViewport(&viewportRect); |
| 591 return viewportRect.width; | 599 return viewportRect.width; |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1110 { | 1118 { |
| 1111 return adoptPtr(m_webView->scheduler()->createFrameScheduler(blameContext).r elease()); | 1119 return adoptPtr(m_webView->scheduler()->createFrameScheduler(blameContext).r elease()); |
| 1112 } | 1120 } |
| 1113 | 1121 |
| 1114 double ChromeClientImpl::lastFrameTimeMonotonic() const | 1122 double ChromeClientImpl::lastFrameTimeMonotonic() const |
| 1115 { | 1123 { |
| 1116 return m_webView->lastFrameTimeMonotonic(); | 1124 return m_webView->lastFrameTimeMonotonic(); |
| 1117 } | 1125 } |
| 1118 | 1126 |
| 1119 } // namespace blink | 1127 } // namespace blink |
| OLD | NEW |