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

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

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adress Dmitry's comments + sync. Created 4 years, 2 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #include "public/web/WebTextDirection.h" 96 #include "public/web/WebTextDirection.h"
97 #include "public/web/WebTouchAction.h" 97 #include "public/web/WebTouchAction.h"
98 #include "public/web/WebUserGestureIndicator.h" 98 #include "public/web/WebUserGestureIndicator.h"
99 #include "public/web/WebUserGestureToken.h" 99 #include "public/web/WebUserGestureToken.h"
100 #include "public/web/WebViewClient.h" 100 #include "public/web/WebViewClient.h"
101 #include "public/web/WebWindowFeatures.h" 101 #include "public/web/WebWindowFeatures.h"
102 #include "web/AudioOutputDeviceClientImpl.h" 102 #include "web/AudioOutputDeviceClientImpl.h"
103 #include "web/ColorChooserPopupUIController.h" 103 #include "web/ColorChooserPopupUIController.h"
104 #include "web/ColorChooserUIController.h" 104 #include "web/ColorChooserUIController.h"
105 #include "web/DateTimeChooserImpl.h" 105 #include "web/DateTimeChooserImpl.h"
106 #include "web/DevToolsEmulator.h"
106 #include "web/ExternalDateTimeChooser.h" 107 #include "web/ExternalDateTimeChooser.h"
107 #include "web/ExternalPopupMenu.h" 108 #include "web/ExternalPopupMenu.h"
108 #include "web/IndexedDBClientImpl.h" 109 #include "web/IndexedDBClientImpl.h"
109 #include "web/LocalFileSystemClient.h" 110 #include "web/LocalFileSystemClient.h"
110 #include "web/NavigatorContentUtilsClientImpl.h" 111 #include "web/NavigatorContentUtilsClientImpl.h"
111 #include "web/PopupMenuImpl.h" 112 #include "web/PopupMenuImpl.h"
112 #include "web/WebFileChooserCompletionImpl.h" 113 #include "web/WebFileChooserCompletionImpl.h"
113 #include "web/WebFrameWidgetImpl.h" 114 #include "web/WebFrameWidgetImpl.h"
114 #include "web/WebInputEventConversion.h" 115 #include "web/WebInputEventConversion.h"
115 #include "web/WebLocalFrameImpl.h" 116 #include "web/WebLocalFrameImpl.h"
116 #include "web/WebPluginContainerImpl.h" 117 #include "web/WebPluginContainerImpl.h"
117 #include "web/WebSettingsImpl.h" 118 #include "web/WebSettingsImpl.h"
118 #include "web/WebViewImpl.h" 119 #include "web/WebViewImpl.h"
120 #include "wtf/Optional.h"
119 #include "wtf/PtrUtil.h" 121 #include "wtf/PtrUtil.h"
120 #include "wtf/text/CString.h" 122 #include "wtf/text/CString.h"
121 #include "wtf/text/CharacterNames.h" 123 #include "wtf/text/CharacterNames.h"
122 #include "wtf/text/StringBuilder.h" 124 #include "wtf/text/StringBuilder.h"
123 #include "wtf/text/StringConcatenate.h" 125 #include "wtf/text/StringConcatenate.h"
124 #include <memory> 126 #include <memory>
125 127
126 namespace blink { 128 namespace blink {
127 129
128 namespace { 130 namespace {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 WebFloatRect viewportRect(0, 0, scalarValue, 0); 599 WebFloatRect viewportRect(0, 0, scalarValue, 0);
598 m_webView->client()->convertWindowToViewport(&viewportRect); 600 m_webView->client()->convertWindowToViewport(&viewportRect);
599 return viewportRect.width; 601 return viewportRect.width;
600 } 602 }
601 603
602 WebScreenInfo ChromeClientImpl::screenInfo() const 604 WebScreenInfo ChromeClientImpl::screenInfo() const
603 { 605 {
604 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn fo(); 606 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn fo();
605 } 607 }
606 608
609 WTF::Optional<IntRect> ChromeClientImpl::visibleContentRectForPainting() const
610 {
611 return m_webView->devToolsEmulator()->visibleContentRectForPainting();
612 }
613
607 void ChromeClientImpl::contentsSizeChanged(LocalFrame* frame, const IntSize& siz e) const 614 void ChromeClientImpl::contentsSizeChanged(LocalFrame* frame, const IntSize& siz e) const
608 { 615 {
609 m_webView->didChangeContentsSize(); 616 m_webView->didChangeContentsSize();
610 617
611 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); 618 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
612 webframe->didChangeContentsSize(size); 619 webframe->didChangeContentsSize(size);
613 } 620 }
614 621
615 void ChromeClientImpl::pageScaleFactorChanged() const 622 void ChromeClientImpl::pageScaleFactorChanged() const
616 { 623 {
617 m_webView->pageScaleFactorChanged(); 624 m_webView->pageScaleFactorChanged();
618 } 625 }
619 626
627 void ChromeClientImpl::mainFrameScrollOffsetChanged() const
628 {
629 m_webView->mainFrameScrollOffsetChanged();
630 }
631
620 float ChromeClientImpl::clampPageScaleFactorToLimits(float scale) const 632 float ChromeClientImpl::clampPageScaleFactorToLimits(float scale) const
621 { 633 {
622 return m_webView->clampPageScaleFactorToLimits(scale); 634 return m_webView->clampPageScaleFactorToLimits(scale);
623 } 635 }
624 636
625 void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const 637 void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const
626 { 638 {
627 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame)); 639 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame));
628 } 640 }
629 641
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 ScreenOrientationController::provideTo(frame, client ? client->webScreenOrie ntationClient() : nullptr); 1151 ScreenOrientationController::provideTo(frame, client ? client->webScreenOrie ntationClient() : nullptr);
1140 if (RuntimeEnabledFeatures::presentationEnabled()) 1152 if (RuntimeEnabledFeatures::presentationEnabled())
1141 PresentationController::provideTo(frame, client ? client->presentationCl ient() : nullptr); 1153 PresentationController::provideTo(frame, client ? client->presentationCl ient() : nullptr);
1142 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) 1154 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
1143 provideAudioOutputDeviceClientTo(frame, AudioOutputDeviceClientImpl::cre ate()); 1155 provideAudioOutputDeviceClientTo(frame, AudioOutputDeviceClientImpl::cre ate());
1144 if (RuntimeEnabledFeatures::installedAppEnabled()) 1156 if (RuntimeEnabledFeatures::installedAppEnabled())
1145 InstalledAppController::provideTo(frame, client ? client->installedAppCl ient() : nullptr); 1157 InstalledAppController::provideTo(frame, client ? client->installedAppCl ient() : nullptr);
1146 } 1158 }
1147 1159
1148 } // namespace blink 1160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | third_party/WebKit/Source/web/DevToolsEmulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698