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

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, 10 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "platform/Cursor.h" 57 #include "platform/Cursor.h"
58 #include "platform/FileChooser.h" 58 #include "platform/FileChooser.h"
59 #include "platform/KeyboardCodes.h" 59 #include "platform/KeyboardCodes.h"
60 #include "platform/RuntimeEnabledFeatures.h" 60 #include "platform/RuntimeEnabledFeatures.h"
61 #include "platform/exported/WrappedResourceRequest.h" 61 #include "platform/exported/WrappedResourceRequest.h"
62 #include "platform/geometry/IntRect.h" 62 #include "platform/geometry/IntRect.h"
63 #include "platform/graphics/GraphicsLayer.h" 63 #include "platform/graphics/GraphicsLayer.h"
64 #include "platform/weborigin/SecurityOrigin.h" 64 #include "platform/weborigin/SecurityOrigin.h"
65 #include "public/platform/Platform.h" 65 #include "public/platform/Platform.h"
66 #include "public/platform/WebCursorInfo.h" 66 #include "public/platform/WebCursorInfo.h"
67 #include "public/platform/WebFloatRect.h"
67 #include "public/platform/WebFrameScheduler.h" 68 #include "public/platform/WebFrameScheduler.h"
68 #include "public/platform/WebRect.h" 69 #include "public/platform/WebRect.h"
69 #include "public/platform/WebURLRequest.h" 70 #include "public/platform/WebURLRequest.h"
70 #include "public/platform/WebViewScheduler.h" 71 #include "public/platform/WebViewScheduler.h"
71 #include "public/web/WebAXObject.h" 72 #include "public/web/WebAXObject.h"
72 #include "public/web/WebAutofillClient.h" 73 #include "public/web/WebAutofillClient.h"
73 #include "public/web/WebColorChooser.h" 74 #include "public/web/WebColorChooser.h"
74 #include "public/web/WebColorSuggestion.h" 75 #include "public/web/WebColorSuggestion.h"
75 #include "public/web/WebConsoleMessage.h" 76 #include "public/web/WebConsoleMessage.h"
76 #include "public/web/WebFrameClient.h" 77 #include "public/web/WebFrameClient.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 513
513 if (m_webView->client()) { 514 if (m_webView->client()) {
514 m_webView->client()->convertViewportToWindow(&screenRect); 515 m_webView->client()->convertViewportToWindow(&screenRect);
515 WebRect windowRect = m_webView->client()->windowRect(); 516 WebRect windowRect = m_webView->client()->windowRect();
516 screenRect.x += windowRect.x; 517 screenRect.x += windowRect.x;
517 screenRect.y += windowRect.y; 518 screenRect.y += windowRect.y;
518 } 519 }
519 return screenRect; 520 return screenRect;
520 } 521 }
521 522
523 FloatRect ChromeClientImpl::windowToViewport(const FloatRect& rectInWindow) cons t
524 {
525 WebFloatRect viewportRect(rectInWindow);
526 if (m_webView->client())
527 m_webView->client()->convertWindowToViewport(&viewportRect);
528 return viewportRect;
529 }
530
522 WebScreenInfo ChromeClientImpl::screenInfo() const 531 WebScreenInfo ChromeClientImpl::screenInfo() const
523 { 532 {
524 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn fo(); 533 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn fo();
525 } 534 }
526 535
527 void ChromeClientImpl::contentsSizeChanged(LocalFrame* frame, const IntSize& siz e) const 536 void ChromeClientImpl::contentsSizeChanged(LocalFrame* frame, const IntSize& siz e) const
528 { 537 {
529 m_webView->didChangeContentsSize(); 538 m_webView->didChangeContentsSize();
530 539
531 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); 540 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 if (m_webView->pageImportanceSignals()) 1032 if (m_webView->pageImportanceSignals())
1024 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); 1033 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript();
1025 } 1034 }
1026 1035
1027 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() 1036 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler()
1028 { 1037 {
1029 return m_webView->scheduler()->createFrameScheduler().release(); 1038 return m_webView->scheduler()->createFrameScheduler().release();
1030 } 1039 }
1031 1040
1032 } // namespace blink 1041 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698