Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 1603253003: Add dedicated windowToViewport method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 512
513 if (m_webView->client()) { 513 if (m_webView->client()) {
514 m_webView->client()->convertViewportToWindow(&screenRect); 514 m_webView->client()->convertViewportToWindow(&screenRect);
515 WebRect windowRect = m_webView->client()->windowRect(); 515 WebRect windowRect = m_webView->client()->windowRect();
516 screenRect.x += windowRect.x; 516 screenRect.x += windowRect.x;
517 screenRect.y += windowRect.y; 517 screenRect.y += windowRect.y;
518 } 518 }
519 return screenRect; 519 return screenRect;
520 } 520 }
521 521
522 float ChromeClientImpl::windowToViewport(float scalar) const
523 {
524 return m_webView->client() ? m_webView->client()->convertWindowToViewport(sc alar) : scalar;
525 }
526
522 WebScreenInfo ChromeClientImpl::screenInfo() const 527 WebScreenInfo ChromeClientImpl::screenInfo() const
523 { 528 {
524 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn fo(); 529 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn fo();
525 } 530 }
526 531
527 void ChromeClientImpl::contentsSizeChanged(LocalFrame* frame, const IntSize& siz e) const 532 void ChromeClientImpl::contentsSizeChanged(LocalFrame* frame, const IntSize& siz e) const
528 { 533 {
529 m_webView->didChangeContentsSize(); 534 m_webView->didChangeContentsSize();
530 535
531 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); 536 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 if (m_webView->pageImportanceSignals()) 1028 if (m_webView->pageImportanceSignals())
1024 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); 1029 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript();
1025 } 1030 }
1026 1031
1027 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() 1032 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler()
1028 { 1033 {
1029 return m_webView->scheduler()->createFrameScheduler().release(); 1034 return m_webView->scheduler()->createFrameScheduler().release();
1030 } 1035 }
1031 1036
1032 } // namespace blink 1037 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698