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

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

Issue 2585113005: DevTools: make ignoreInputEvents a static flag (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 m_zoomLevel(0), 351 m_zoomLevel(0),
352 m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)), 352 m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)),
353 m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)), 353 m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)),
354 m_zoomFactorForDeviceScaleFactor(0.f), 354 m_zoomFactorForDeviceScaleFactor(0.f),
355 m_maximumLegibleScale(1), 355 m_maximumLegibleScale(1),
356 m_doubleTapZoomPageScaleFactor(0), 356 m_doubleTapZoomPageScaleFactor(0),
357 m_doubleTapZoomPending(false), 357 m_doubleTapZoomPending(false),
358 m_enableFakePageScaleAnimationForTesting(false), 358 m_enableFakePageScaleAnimationForTesting(false),
359 m_fakePageScaleAnimationPageScaleFactor(0), 359 m_fakePageScaleAnimationPageScaleFactor(0),
360 m_fakePageScaleAnimationUseAnchor(false), 360 m_fakePageScaleAnimationUseAnchor(false),
361 m_ignoreInputEvents(false),
362 m_compositorDeviceScaleFactorOverride(0), 361 m_compositorDeviceScaleFactorOverride(0),
363 m_suppressNextKeypressEvent(false), 362 m_suppressNextKeypressEvent(false),
364 m_imeAcceptEvents(true), 363 m_imeAcceptEvents(true),
365 m_devToolsEmulator(nullptr), 364 m_devToolsEmulator(nullptr),
366 m_isTransparent(false), 365 m_isTransparent(false),
367 m_tabsToLinks(false), 366 m_tabsToLinks(false),
368 m_layerTreeView(nullptr), 367 m_layerTreeView(nullptr),
369 m_rootLayer(nullptr), 368 m_rootLayer(nullptr),
370 m_rootGraphicsLayer(nullptr), 369 m_rootGraphicsLayer(nullptr),
371 m_visualViewportContainerLayer(nullptr), 370 m_visualViewportContainerLayer(nullptr),
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 } 1739 }
1741 1740
1742 WebViewImpl* WebViewImpl::fromPage(Page* page) { 1741 WebViewImpl* WebViewImpl::fromPage(Page* page) {
1743 return page ? static_cast<WebViewImpl*>(page->chromeClient().webView()) 1742 return page ? static_cast<WebViewImpl*>(page->chromeClient().webView())
1744 : nullptr; 1743 : nullptr;
1745 } 1744 }
1746 1745
1747 // WebWidget ------------------------------------------------------------------ 1746 // WebWidget ------------------------------------------------------------------
1748 1747
1749 void WebViewImpl::close() { 1748 void WebViewImpl::close() {
1750 WebDevToolsAgentImpl::webViewImplClosed(this);
1751 DCHECK(allInstances().contains(this)); 1749 DCHECK(allInstances().contains(this));
1752 allInstances().remove(this); 1750 allInstances().remove(this);
1753 1751
1754 if (m_page) { 1752 if (m_page) {
1755 // Initiate shutdown for the entire frameset. This will cause a lot of 1753 // Initiate shutdown for the entire frameset. This will cause a lot of
1756 // notifications to be sent. 1754 // notifications to be sent.
1757 m_page->willBeDestroyed(); 1755 m_page->willBeDestroyed();
1758 m_page.clear(); 1756 m_page.clear();
1759 } 1757 }
1760 1758
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2141 if (m_devToolsEmulator->handleInputEvent(inputEvent)) 2139 if (m_devToolsEmulator->handleInputEvent(inputEvent))
2142 return WebInputEventResult::HandledSuppressed; 2140 return WebInputEventResult::HandledSuppressed;
2143 2141
2144 if (InspectorOverlay* overlay = inspectorOverlay()) { 2142 if (InspectorOverlay* overlay = inspectorOverlay()) {
2145 if (overlay->handleInputEvent(inputEvent)) 2143 if (overlay->handleInputEvent(inputEvent))
2146 return WebInputEventResult::HandledSuppressed; 2144 return WebInputEventResult::HandledSuppressed;
2147 } 2145 }
2148 2146
2149 // Report the event to be NOT processed by WebKit, so that the browser can 2147 // Report the event to be NOT processed by WebKit, so that the browser can
2150 // handle it appropriately. 2148 // handle it appropriately.
2151 if (m_ignoreInputEvents) 2149 if (WebFrameWidgetBase::ignoreInputEvents())
2152 return WebInputEventResult::NotHandled; 2150 return WebInputEventResult::NotHandled;
2153 2151
2154 AutoReset<const WebInputEvent*> currentEventChange(&m_currentInputEvent, 2152 AutoReset<const WebInputEvent*> currentEventChange(&m_currentInputEvent,
2155 &inputEvent); 2153 &inputEvent);
2156 UIEventWithKeyState::clearNewTabModifierSetFromIsolatedWorld(); 2154 UIEventWithKeyState::clearNewTabModifierSetFromIsolatedWorld();
2157 2155
2158 bool isPointerLocked = false; 2156 bool isPointerLocked = false;
2159 if (WebFrameWidgetBase* widget = mainFrameImpl()->frameWidget()) { 2157 if (WebFrameWidgetBase* widget = mainFrameImpl()->frameWidget()) {
2160 if (WebWidgetClient* client = widget->client()) 2158 if (WebWidgetClient* client = widget->client())
2161 isPointerLocked = client->isPointerLocked(); 2159 isPointerLocked = client->isPointerLocked();
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
3714 } 3712 }
3715 3713
3716 void WebViewImpl::mainFrameScrollOffsetChanged() { 3714 void WebViewImpl::mainFrameScrollOffsetChanged() {
3717 m_devToolsEmulator->mainFrameScrollOrScaleChanged(); 3715 m_devToolsEmulator->mainFrameScrollOrScaleChanged();
3718 } 3716 }
3719 3717
3720 bool WebViewImpl::useExternalPopupMenus() { 3718 bool WebViewImpl::useExternalPopupMenus() {
3721 return shouldUseExternalPopupMenus; 3719 return shouldUseExternalPopupMenus;
3722 } 3720 }
3723 3721
3724 void WebViewImpl::setIgnoreInputEvents(bool newValue) {
3725 DCHECK_NE(m_ignoreInputEvents, newValue);
3726 m_ignoreInputEvents = newValue;
3727 }
3728
3729 void WebViewImpl::setBackgroundColorOverride(WebColor color) { 3722 void WebViewImpl::setBackgroundColorOverride(WebColor color) {
3730 m_backgroundColorOverride = color; 3723 m_backgroundColorOverride = color;
3731 updateLayerTreeBackgroundColor(); 3724 updateLayerTreeBackgroundColor();
3732 } 3725 }
3733 3726
3734 void WebViewImpl::setZoomFactorOverride(float zoomFactor) { 3727 void WebViewImpl::setZoomFactorOverride(float zoomFactor) {
3735 m_zoomFactorOverride = zoomFactor; 3728 m_zoomFactorOverride = zoomFactor;
3736 setZoomLevel(zoomLevel()); 3729 setZoomLevel(zoomLevel());
3737 } 3730 }
3738 3731
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
4209 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4202 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4210 return nullptr; 4203 return nullptr;
4211 return focusedFrame; 4204 return focusedFrame;
4212 } 4205 }
4213 4206
4214 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4207 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4215 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4208 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4216 } 4209 }
4217 4210
4218 } // namespace blink 4211 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698