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 WebWidgetClient* client = WebLocalFrameImpl::fromFrame(frame)->frameWidget() ->client(); |
| 571 if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(fram e)->frameWidget() && WebLocalFrameImpl::fromFrame(frame)->frameWidget()->forSubf rame()) | |
| 572 client = toWebFrameWidgetImpl(WebLocalFrameImpl::fromFrame(frame)->frame Widget())->client(); | |
| 573 else | |
| 574 client = m_webView->client(); | |
| 575 | 570 |
| 576 if (client) { | 571 if (client) { |
|
dcheng
2016/04/28 17:30:21
Out of curiosity, does anyone actually pass a null
lfg
2016/04/28 17:43:57
I haven't checked, but this should never happen, s
| |
| 577 client->convertViewportToWindow(&screenRect); | 572 client->convertViewportToWindow(&screenRect); |
| 578 WebRect windowRect = client->windowRect(); | 573 WebRect windowRect = client->windowRect(); |
| 579 screenRect.x += windowRect.x; | 574 screenRect.x += windowRect.x; |
| 580 screenRect.y += windowRect.y; | 575 screenRect.y += windowRect.y; |
| 581 } | 576 } |
| 577 | |
| 582 return screenRect; | 578 return screenRect; |
| 583 } | 579 } |
| 584 | 580 |
| 585 float ChromeClientImpl::windowToViewportScalar(const float scalarValue) const | 581 float ChromeClientImpl::windowToViewportScalar(const float scalarValue) const |
| 586 { | 582 { |
| 587 if (!m_webView->client()) | 583 if (!m_webView->client()) |
| 588 return scalarValue; | 584 return scalarValue; |
| 589 WebFloatRect viewportRect(0, 0, scalarValue, 0); | 585 WebFloatRect viewportRect(0, 0, scalarValue, 0); |
| 590 m_webView->client()->convertWindowToViewport(&viewportRect); | 586 m_webView->client()->convertWindowToViewport(&viewportRect); |
| 591 return viewportRect.width; | 587 return viewportRect.width; |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1118 { | 1114 { |
| 1119 return adoptPtr(m_webView->scheduler()->createFrameScheduler(blameContext).r elease()); | 1115 return adoptPtr(m_webView->scheduler()->createFrameScheduler(blameContext).r elease()); |
| 1120 } | 1116 } |
| 1121 | 1117 |
| 1122 double ChromeClientImpl::lastFrameTimeMonotonic() const | 1118 double ChromeClientImpl::lastFrameTimeMonotonic() const |
| 1123 { | 1119 { |
| 1124 return m_webView->lastFrameTimeMonotonic(); | 1120 return m_webView->lastFrameTimeMonotonic(); |
| 1125 } | 1121 } |
| 1126 | 1122 |
| 1127 } // namespace blink | 1123 } // namespace blink |
| OLD | NEW |