2 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include "WebNavigationPolicy.h"
35 #include "platform/WebLayer.h"
36 #include "platform/WebLayerTreeView.h"
37 #include "platform/WebLayerTreeViewClient.h"
38 #include "platform/WebPoint.h"
39 #include "platform/WebRect.h"
40 #include "platform/WebSize.h"
41 #include "platform/WebString.h"
44 #include "ChromeClientImpl.h"
45 #include "ContextMenuClientImpl.h"
46 #include "DragClientImpl.h"
47 #include "EditorClientImpl.h"
48 #include "GraphicsContext3D.h"
49 #include "GraphicsLayer.h"
50 #include "InspectorClientImpl.h"
53 #include "NotificationPresenterImpl.h"
54 #include "PageOverlayList.h"
55 #include "PageWidgetDelegate.h"
56 #include "PlatformGestureCurveTarget.h"
57 #include "UserMediaClientImpl.h"
58 #include <wtf/OwnPtr.h>
59 #include <wtf/RefCounted.h>
62 class ActivePlatformGestureAnimation;
63 class ChromiumDataObject;
67 class GraphicsContext3D;
73 class PagePopupClient;
74 class PlatformGestureCurveTarget;
75 class PlatformKeyboardEvent;
77 class PopupMenuClient;
80 class TextFieldDecorator;
85 class AutocompletePopupMenuClient;
86 class AutofillPopupMenuClient;
87 class BatteryClientImpl;
88 class ContextMenuClientImpl;
89 class DeviceOrientationClientProxy;
90 class DragScrollTimer;
91 class GeolocationClientProxy;
92 class NonCompositedContentHost;
93 class PrerendererClientImpl;
94 class SpeechInputClientImpl;
95 class SpeechRecognitionClientProxy;
96 class UserMediaClientImpl;
97 class WebAccessibilityObject;
98 class WebCompositorImpl;
99 class WebDevToolsAgentClient;
100 class WebDevToolsAgentPrivate;
102 class WebGestureEvent;
103 class WebPagePopupImpl;
104 class WebPrerendererClient;
106 class WebKeyboardEvent;
108 class WebMouseWheelEvent;
109 class WebSettingsImpl;
112 class WebViewImpl : public WebView, public WebLayerTreeViewClient, public RefCounted<WebViewImpl>, public WebCore::PlatformGestureCurveTarget, public PageWidgetEventHandler {
119 // WebWidget methods:
120 virtual void close();
121 virtual WebSize size() { return m_size; }
122 virtual void willStartLiveResize();
123 virtual void resize(const WebSize&);
124 virtual void willEndLiveResize();
125 virtual void willEnterFullScreen();
126 virtual void didEnterFullScreen();
127 virtual void willExitFullScreen();
128 virtual void didExitFullScreen();
129 virtual void setCompositorSurfaceReady();
130 virtual void animate(double);
131 virtual void layout(); // Also implements WebLayerTreeViewClient::layout()
132 virtual void paint(WebCanvas*, const WebRect&);
133 virtual void themeChanged();
134 virtual void composite(bool finish);
135 virtual void setNeedsRedraw();
136 virtual bool isInputThrottled() const;
137 virtual bool handleInputEvent(const WebInputEvent&);
138 virtual void mouseCaptureLost();
139 virtual void setFocus(bool enable);
140 virtual bool setComposition(
141 const WebString& text,
142 const WebVector<WebCompositionUnderline>& underlines,
145 virtual bool confirmComposition();
146 virtual bool confirmComposition(const WebString& text);
147 virtual bool compositionRange(size_t* location, size_t* length);
148 virtual WebTextInputType textInputType();
149 virtual bool selectionBounds(WebRect& start, WebRect& end) const;
150 virtual bool caretOrSelectionRange(size_t* location, size_t* length);
151 virtual void setTextDirection(WebTextDirection direction);
152 virtual bool isAcceleratedCompositingActive() const;
153 virtual void didAcquirePointerLock();
154 virtual void didNotAcquirePointerLock();
155 virtual void didLosePointerLock();
156 virtual void didChangeWindowResizerRect();
157 virtual void instrumentBeginFrame();
158 virtual void instrumentCancelFrame();
161 virtual void initializeMainFrame(WebFrameClient*);
162 virtual void setAutofillClient(WebAutofillClient*);
163 virtual void setDevToolsAgentClient(WebDevToolsAgentClient*);
164 virtual void setPermissionClient(WebPermissionClient*);
165 virtual void setPrerendererClient(WebPrerendererClient*) OVERRIDE;
166 virtual void setSpellCheckClient(WebSpellCheckClient*);
167 virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) OVERRIDE;
168 virtual WebSettings* settings();
169 virtual WebString pageEncoding() const;
170 virtual void setPageEncoding(const WebString& encoding);
171 virtual bool isTransparent() const;
172 virtual void setIsTransparent(bool value);
173 virtual bool tabsToLinks() const;
174 virtual void setTabsToLinks(bool value);
175 virtual bool tabKeyCyclesThroughElements() const;
176 virtual void setTabKeyCyclesThroughElements(bool value);
177 virtual bool isActive() const;
178 virtual void setIsActive(bool value);
179 virtual void setDomainRelaxationForbidden(bool, const WebString& scheme);
180 virtual bool dispatchBeforeUnloadEvent();
181 virtual void dispatchUnloadEvent();
182 virtual WebFrame* mainFrame();
183 virtual WebFrame* findFrameByName(
184 const WebString& name, WebFrame* relativeToFrame);
185 virtual WebFrame* focusedFrame();
186 virtual void setFocusedFrame(WebFrame* frame);
187 virtual void setInitialFocus(bool reverse);
188 virtual void clearFocusedNode();
189 virtual void scrollFocusedNodeIntoView();
190 virtual void scrollFocusedNodeIntoRect(const WebRect&);
191 virtual double zoomLevel();
192 virtual double setZoomLevel(bool textOnly, double zoomLevel);
193 virtual void zoomLimitsChanged(double minimumZoomLevel,
194 double maximumZoomLevel);
195 virtual float pageScaleFactor() const;
196 virtual bool isPageScaleFactorSet() const;
197 virtual void setPageScaleFactorPreservingScrollOffset(float);
198 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin);
199 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale);
200 virtual float minimumPageScaleFactor() const;
201 virtual float maximumPageScaleFactor() const;
203 virtual float deviceScaleFactor() const;
204 virtual void setDeviceScaleFactor(float);
205 virtual bool isFixedLayoutModeEnabled() const;
206 virtual void enableFixedLayoutMode(bool enable);
207 virtual WebSize fixedLayoutSize() const;
208 virtual void setFixedLayoutSize(const WebSize&);
209 virtual void enableAutoResizeMode(
210 const WebSize& minSize,
211 const WebSize& maxSize);
212 virtual void disableAutoResizeMode();
213 virtual void performMediaPlayerAction(
214 const WebMediaPlayerAction& action,
215 const WebPoint& location);
216 virtual void performPluginAction(
217 const WebPluginAction&,
219 virtual void copyImageAt(const WebPoint& point);
220 virtual void dragSourceEndedAt(
221 const WebPoint& clientPoint,
222 const WebPoint& screenPoint,
223 WebDragOperation operation);
224 virtual void dragSourceMovedTo(
225 const WebPoint& clientPoint,
226 const WebPoint& screenPoint,
227 WebDragOperation operation);
228 virtual void dragSourceSystemDragEnded();
229 virtual WebDragOperation dragTargetDragEnter(
231 const WebPoint& clientPoint,
232 const WebPoint& screenPoint,
233 WebDragOperationsMask operationsAllowed);
234 virtual WebDragOperation dragTargetDragEnter(
236 const WebPoint& clientPoint,
237 const WebPoint& screenPoint,
238 WebDragOperationsMask operationsAllowed,
240 virtual WebDragOperation dragTargetDragOver(
241 const WebPoint& clientPoint,
242 const WebPoint& screenPoint,
243 WebDragOperationsMask operationsAllowed);
244 virtual WebDragOperation dragTargetDragOver(
245 const WebPoint& clientPoint,
246 const WebPoint& screenPoint,
247 WebDragOperationsMask operationsAllowed,
249 virtual void dragTargetDragLeave();
250 virtual void dragTargetDrop(
251 const WebPoint& clientPoint,
252 const WebPoint& screenPoint);
253 virtual void dragTargetDrop(
254 const WebPoint& clientPoint,
255 const WebPoint& screenPoint,
257 virtual unsigned long createUniqueIdentifierForRequest();
258 virtual void inspectElementAt(const WebPoint& point);
259 virtual WebString inspectorSettings() const;
260 virtual void setInspectorSettings(const WebString& settings);
261 virtual bool inspectorSetting(const WebString& key, WebString* value) const;
262 virtual void setInspectorSetting(const WebString& key,
263 const WebString& value);
264 virtual WebDevToolsAgent* devToolsAgent();
265 virtual WebAccessibilityObject accessibilityObject();
266 virtual void applyAutofillSuggestions(
268 const WebVector<WebString>& names,
269 const WebVector<WebString>& labels,
270 const WebVector<WebString>& icons,
271 const WebVector<int>& itemIDs,
273 virtual void hidePopups();
274 virtual void setScrollbarColors(unsigned inactiveColor,
275 unsigned activeColor,
276 unsigned trackColor);
277 virtual void setSelectionColors(unsigned activeBackgroundColor,
278 unsigned activeForegroundColor,
279 unsigned inactiveBackgroundColor,
280 unsigned inactiveForegroundColor);
281 virtual void performCustomContextMenuAction(unsigned action);
282 virtual void addPageOverlay(WebPageOverlay*, int /* zOrder */);
283 virtual void removePageOverlay(WebPageOverlay*);
284 #if ENABLE(BATTERY_STATUS)
285 virtual void updateBatteryStatus(const WebBatteryStatus&);
287 virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&);
289 // WebLayerTreeViewClient
290 virtual void willBeginFrame();
291 virtual void updateAnimations(double monotonicFrameBeginTime);
292 virtual void applyScrollAndScale(const WebSize&, float);
293 virtual WebGraphicsContext3D* createContext3D();
294 virtual void didRebindGraphicsContext(bool);
295 virtual void didCommit();
296 virtual void didCommitAndDrawFrame();
297 virtual void didCompleteSwapBuffers();
298 virtual void scheduleComposite();
302 void setIgnoreInputEvents(bool newValue);
303 WebDevToolsAgentPrivate* devToolsAgentPrivate() { return m_devToolsAgent.get(); }
305 PageOverlayList* pageOverlays() const { return m_pageOverlays.get(); }
307 void setOverlayLayer(WebCore::GraphicsLayer*);
309 const WebPoint& lastMouseDownPoint() const
311 return m_lastMouseDownPoint;
314 WebCore::Frame* focusedWebCoreFrame() const;
316 // Returns the currently focused Node or null if no node has focus.
317 WebCore::Node* focusedWebCoreNode();
319 static WebViewImpl* fromPage(WebCore::Page*);
321 WebViewClient* client()
326 WebAutofillClient* autofillClient()
328 return m_autofillClient;
331 WebPermissionClient* permissionClient()
333 return m_permissionClient;
336 WebSpellCheckClient* spellCheckClient()
338 return m_spellCheckClient;
341 const Vector<OwnPtr<WebCore::TextFieldDecorator> >& textFieldDecorators() const { return m_textFieldDecorators; }
343 // Returns the page object associated with this view. This may be null when
344 // the page is shutting down, but will be valid at all other times.
345 WebCore::Page* page() const
350 WebCore::RenderTheme* theme() const;
352 // Returns the main frame associated with this view. This may be null when
353 // the page is shutting down, but will be valid at all other times.
354 WebFrameImpl* mainFrameImpl();
356 // History related methods:
357 void observeNewNavigation();
359 // Event related methods:
360 void mouseContextMenu(const WebMouseEvent&);
361 void mouseDoubleClick(const WebMouseEvent&);
362 void startPageScaleAnimation(const WebCore::IntPoint& targetPosition, bool useAnchor, float newScale, double durationSec);
364 void numberOfWheelEventHandlersChanged(unsigned);
365 void numberOfTouchEventHandlersChanged(unsigned);
367 // PlatformGestureCurveTarget implementation for wheel fling.
368 virtual void scrollBy(const WebCore::IntPoint&);
370 // Handles context menu events orignated via the the keyboard. These
371 // include the VK_APPS virtual key and the Shift+F10 combine. Code is
372 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM
373 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only
374 // significant change in this function is the code to convert from a
375 // Keyboard event to the Right Mouse button down event.
376 bool sendContextMenuEvent(const WebKeyboardEvent&);
378 // Notifies the WebView that a load has been committed. isNewNavigation
379 // will be true if a new session history item should be created for that
380 // load. isNavigationWithinPage will be true if the navigation does
381 // not take the user away from the current page.
382 void didCommitLoad(bool* isNewNavigation, bool isNavigationWithinPage);
384 // Indicates two things:
385 // 1) This view may have a new layout now.
386 // 2) Calling layout() is a no-op.
387 // After calling WebWidget::layout(), expect to get this notification
388 // unless the view did not need a layout.
389 void layoutUpdated(WebFrameImpl*);
391 void didChangeContentsSize();
393 // Returns true if popup menus should be rendered by the browser, false if
394 // they should be rendered by WebKit (which is the default).
395 static bool useExternalPopupMenus();
397 bool contextMenuAllowed() const
399 return m_contextMenuAllowed;
402 bool shouldAutoResize() const
404 return m_shouldAutoResize;
407 WebCore::IntSize minAutoSize() const
409 return m_minAutoSize;
412 WebCore::IntSize maxAutoSize() const
414 return m_maxAutoSize;
417 // Set the disposition for how this webview is to be initially shown.
418 void setInitialNavigationPolicy(WebNavigationPolicy policy)
420 m_initialNavigationPolicy = policy;
422 WebNavigationPolicy initialNavigationPolicy() const
424 return m_initialNavigationPolicy;
427 // Sets the emulated text zoom factor
428 // (may not be 1 in the device metrics emulation mode).
429 void setEmulatedTextZoomFactor(float);
431 // Returns the emulated text zoom factor
432 // (which may not be 1 in the device metrics emulation mode).
433 float emulatedTextZoomFactor() const
435 return m_emulatedTextZoomFactor;
438 // Determines whether a page should e.g. be opened in a background tab.
439 // Returns false if it has no opinion, in which case it doesn't set *policy.
440 static bool navigationPolicyFromMouseEvent(
441 unsigned short button,
446 WebNavigationPolicy*);
448 // Start a system drag and drop operation.
450 const WebDragData& dragData,
451 WebDragOperationsMask mask,
452 const WebImage& dragImage,
453 const WebPoint& dragImageOffset);
455 void autofillPopupDidHide()
457 m_autofillPopupShowing = false;
460 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
461 // Returns the provider of desktop notifications.
462 NotificationPresenterImpl* notificationPresenterImpl();
465 // Tries to scroll a frame or any parent of a frame. Returns true if the view
467 bool propagateScroll(WebCore::ScrollDirection, WebCore::ScrollGranularity);
469 // Notification that a popup was opened/closed.
470 void popupOpened(WebCore::PopupContainer* popupContainer);
471 void popupClosed(WebCore::PopupContainer* popupContainer);
472 #if ENABLE(PAGE_POPUP)
473 WebCore::PagePopup* openPagePopup(WebCore::PagePopupClient*, const WebCore::IntRect& originBoundsInRootView);
474 void closePagePopup(WebCore::PagePopup*);
477 void hideAutofillPopup();
479 // Returns the input event we're currently processing. This is used in some
480 // cases where the WebCore DOM event doesn't have the information we need.
481 static const WebInputEvent* currentInputEvent()
483 return m_currentInputEvent;
486 #if USE(ACCELERATED_COMPOSITING)
487 bool allowsAcceleratedCompositing();
488 bool pageHasRTLStyle() const;
489 void setRootGraphicsLayer(WebCore::GraphicsLayer*);
490 void scheduleCompositingLayerSync();
491 void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect);
492 void invalidateRootLayerRect(const WebCore::IntRect&);
493 NonCompositedContentHost* nonCompositedContentHost();
494 void setBackgroundColor(const WebCore::Color&);
496 #if ENABLE(REQUEST_ANIMATION_FRAME)
497 void scheduleAnimation();
500 // Returns the onscreen 3D context used by the compositor. This is
501 // used by the renderer's code to set up resource sharing between
502 // the compositor's context and subordinate contexts for APIs like
503 // WebGL. Returns 0 if compositing support is not compiled in or
504 // we could not successfully instantiate a context.
505 virtual WebGraphicsContext3D* graphicsContext3D();
507 virtual WebGraphicsContext3D* sharedGraphicsContext3D();
509 PassOwnPtr<WebGraphicsContext3D> createCompositorGraphicsContext3D();
511 virtual void setVisibilityState(WebPageVisibilityState, bool);
513 WebCore::PopupContainer* selectPopup() const { return m_selectPopup.get(); }
514 #if ENABLE(PAGE_POPUP)
515 bool hasOpenedPopup() const { return m_selectPopup || m_pagePopup; }
517 bool hasOpenedPopup() const { return m_selectPopup; }
520 // Returns true if the event leads to scrolling.
521 static bool mapKeyCodeForScroll(int keyCode,
522 WebCore::ScrollDirection* scrollDirection,
523 WebCore::ScrollGranularity* scrollGranularity);
525 // Called by a full frame plugin inside this view to inform it that its
526 // zoom level has been updated. The plugin should only call this function
527 // if the zoom change was triggered by the browser, it's only needed in case
528 // a plugin can update its own zoom, say because of its own UI.
529 void fullFramePluginZoomLevelChanged(double zoomLevel);
531 #if ENABLE(GESTURE_EVENTS)
532 void computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType, float& scale, WebPoint& scroll);
535 void loseCompositorContext(int numTimes);
537 void enterFullScreenForElement(WebCore::Element*);
538 void exitFullScreenForElement(WebCore::Element*);
540 // Exposed for the purpose of overriding device metrics.
541 void sendResizeEventAndRepaint();
543 // Exposed for testing purposes.
544 bool hasHorizontalScrollbar();
545 bool hasVerticalScrollbar();
547 // Pointer Lock calls allow a page to capture all mouse events and
548 // disable the system cursor.
549 #if ENABLE(POINTER_LOCK)
550 virtual bool requestPointerLock();
551 virtual void requestPointerUnlock();
552 virtual bool isPointerLocked();
556 bool computePageScaleFactorLimits();
557 float clampPageScaleFactorToLimits(float scale);
558 WebPoint clampOffsetAtScale(const WebPoint& offset, float scale);
560 friend class WebView; // So WebView::Create can call our constructor
561 friend class WTF::RefCounted<WebViewImpl>;
568 WebViewImpl(WebViewClient*);
569 virtual ~WebViewImpl();
571 // Returns true if the event was actually processed.
572 bool keyEventDefault(const WebKeyboardEvent&);
574 // Returns true if the autocomple has consumed the event.
575 bool autocompleteHandleKeyEvent(const WebKeyboardEvent&);
577 // Repaints the Autofill popup. Should be called when the suggestions
578 // have changed. Note that this should only be called when the Autofill
580 void refreshAutofillPopup();
582 // Returns true if the view was scrolled.
583 bool scrollViewWithKeyboard(int keyCode, int modifiers);
585 void hideSelectPopup();
587 // Converts |pos| from window coordinates to contents coordinates and gets
588 // the HitTestResult for it.
589 WebCore::HitTestResult hitTestResultForWindowPos(const WebCore::IntPoint&);
591 // Consolidate some common code between starting a drag over a target and
592 // updating a drag over a target. If we're starting a drag, |isEntering|
594 WebDragOperation dragTargetDragEnterOrOver(const WebPoint& clientPoint,
595 const WebPoint& screenPoint,
599 void configureAutoResizeMode();
601 #if USE(ACCELERATED_COMPOSITING)
602 void setIsAcceleratedCompositingActive(bool);
604 void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&);
605 void reallocateRenderer();
606 void updateLayerTreeViewport();
609 #if ENABLE(GESTURE_EVENTS)
610 // Returns the bounding box of the block type node touched by the WebRect.
611 WebRect computeBlockBounds(const WebRect&, AutoZoomType);
613 // Helper function: Widens the width of |source| by the specified margins
614 // while keeping it smaller than page width.
615 WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, int minimumMargin);
618 #if ENABLE(POINTER_LOCK)
619 void pointerLockMouseEvent(const WebInputEvent&);
622 // PageWidgetEventHandler functions
623 virtual void handleMouseLeave(WebCore::Frame&, const WebMouseEvent&) OVERRIDE;
624 virtual void handleMouseDown(WebCore::Frame&, const WebMouseEvent&) OVERRIDE;
625 virtual void handleMouseUp(WebCore::Frame&, const WebMouseEvent&) OVERRIDE;
626 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE;
627 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE;
628 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE;
630 WebSettingsImpl* settingsImpl();
632 WebViewClient* m_client;
633 WebAutofillClient* m_autofillClient;
634 WebPermissionClient* m_permissionClient;
635 WebSpellCheckClient* m_spellCheckClient;
636 Vector<OwnPtr<WebCore::TextFieldDecorator> > m_textFieldDecorators;
638 ChromeClientImpl m_chromeClientImpl;
639 ContextMenuClientImpl m_contextMenuClientImpl;
640 DragClientImpl m_dragClientImpl;
641 EditorClientImpl m_editorClientImpl;
642 InspectorClientImpl m_inspectorClientImpl;
645 // If true, automatically resize the render view around its content.
646 bool m_shouldAutoResize;
647 // The lower bound on the size when auto-resizing.
648 WebCore::IntSize m_minAutoSize;
649 // The upper bound on the size when auto-resizing.
650 WebCore::IntSize m_maxAutoSize;
652 OwnPtr<WebCore::Page> m_page;
654 // This flag is set when a new navigation is detected. It is used to satisfy
655 // the corresponding argument to WebFrameClient::didCommitProvisionalLoad.
656 bool m_observedNewNavigation;
658 // Used to assert that the new navigation we observed is the same navigation
659 // when we make use of m_observedNewNavigation.
660 const WebCore::DocumentLoader* m_newNavigationLoader;
663 // An object that can be used to manipulate m_page->settings() without linking
664 // against WebCore. This is lazily allocated the first time GetWebSettings()
666 OwnPtr<WebSettingsImpl> m_webSettings;
668 // A copy of the web drop data object we received from the browser.
669 RefPtr<WebCore::ChromiumDataObject> m_currentDragData;
671 // The point relative to the client area where the mouse was last pressed
672 // down. This is used by the drag client to determine what was under the
673 // mouse when the drag was initiated. We need to track this here in
674 // WebViewImpl since DragClient::startDrag does not pass the position the
675 // mouse was at when the drag was initiated, only the current point, which
676 // can be misleading as it is usually not over the element the user actually
677 // dragged by the time a drag is initiated.
678 WebPoint m_lastMouseDownPoint;
680 // Keeps track of the current zoom level. 0 means no zoom, positive numbers
681 // mean zoom in, negative numbers mean zoom out.
684 double m_minimumZoomLevel;
686 double m_maximumZoomLevel;
688 float m_pageDefinedMinimumPageScaleFactor;
689 float m_pageDefinedMaximumPageScaleFactor;
690 float m_minimumPageScaleFactor;
691 float m_maximumPageScaleFactor;
693 bool m_pageScaleFactorIsSet;
695 bool m_contextMenuAllowed;
697 bool m_doingDragAndDrop;
699 bool m_ignoreInputEvents;
701 // Webkit expects keyPress events to be suppressed if the associated keyDown
702 // event was handled. Safari implements this behavior by peeking out the
703 // associated WM_CHAR event if the keydown was handled. We emulate
704 // this behavior by setting this flag if the keyDown was handled.
705 bool m_suppressNextKeypressEvent;
707 // The policy for how this webview is to be initially shown.
708 WebNavigationPolicy m_initialNavigationPolicy;
710 // Represents whether or not this object should process incoming IME events.
711 bool m_imeAcceptEvents;
713 // The available drag operations (copy, move link...) allowed by the source.
714 WebDragOperation m_operationsAllowed;
716 // The current drag operation as negotiated by the source and destination.
717 // When not equal to DragOperationNone, the drag data can be dropped onto the
718 // current drop target in this WebView (the drop target can accept the drop).
719 WebDragOperation m_dragOperation;
721 // Whether an Autofill popup is currently showing.
722 bool m_autofillPopupShowing;
724 // The Autofill popup client.
725 OwnPtr<AutofillPopupMenuClient> m_autofillPopupClient;
727 // The Autofill popup.
728 RefPtr<WebCore::PopupContainer> m_autofillPopup;
730 // The popup associated with a select element.
731 RefPtr<WebCore::PopupContainer> m_selectPopup;
733 #if ENABLE(PAGE_POPUP)
734 // The popup associated with an input element.
735 RefPtr<WebPagePopupImpl> m_pagePopup;
738 OwnPtr<WebDevToolsAgentPrivate> m_devToolsAgent;
739 OwnPtr<PageOverlayList> m_pageOverlays;
741 // Whether the webview is rendering transparently.
742 bool m_isTransparent;
744 // Whether the user can press tab to focus links.
747 // Inspector settings.
748 WebString m_inspectorSettings;
750 typedef HashMap<WTF::String, WTF::String> SettingsMap;
751 OwnPtr<SettingsMap> m_inspectorSettingsMap;
752 OwnPtr<DragScrollTimer> m_dragScrollTimer;
754 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
755 // The provider of desktop notifications;
756 NotificationPresenterImpl m_notificationPresenter;
759 // If set, the (plugin) node which has mouse capture.
760 RefPtr<WebCore::Node> m_mouseCaptureNode;
762 // If set, the WebView is transitioning to fullscreen for this element.
763 RefPtr<WebCore::Element> m_provisionalFullScreenElement;
765 // If set, the WebView is in fullscreen mode for an element in this frame.
766 RefPtr<WebCore::Frame> m_fullScreenFrame;
767 bool m_isCancelingFullScreen;
769 #if USE(ACCELERATED_COMPOSITING)
770 WebCore::IntRect m_rootLayerScrollDamage;
771 OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost;
772 WebLayerTreeView m_layerTreeView;
773 WebLayer m_rootLayer;
774 WebCore::GraphicsLayer* m_rootGraphicsLayer;
775 bool m_isAcceleratedCompositingActive;
776 bool m_compositorCreationFailed;
777 // If true, the graphics context is being restored.
778 bool m_recreatingGraphicsContext;
779 bool m_compositorSurfaceReady;
781 static const WebInputEvent* m_currentInputEvent;
783 #if ENABLE(INPUT_SPEECH)
784 OwnPtr<SpeechInputClientImpl> m_speechInputClient;
786 #if ENABLE(SCRIPTED_SPEECH)
787 OwnPtr<SpeechRecognitionClientProxy> m_speechRecognitionClient;
790 // If we attempt to fetch the on-screen GraphicsContext3D before
791 // the compositor has been turned on, we need to instantiate it
792 // early. This member holds on to the GC3D in this case.
793 OwnPtr<WebGraphicsContext3D> m_temporaryOnscreenGraphicsContext3D;
794 OwnPtr<DeviceOrientationClientProxy> m_deviceOrientationClientProxy;
795 OwnPtr<GeolocationClientProxy> m_geolocationClientProxy;
796 #if ENABLE(BATTERY_STATUS)
797 OwnPtr<BatteryClientImpl> m_batteryClient;
800 float m_emulatedTextZoomFactor;
802 #if ENABLE(MEDIA_STREAM)
803 UserMediaClientImpl m_userMediaClientImpl;
805 OwnPtr<WebCore::ActivePlatformGestureAnimation> m_gestureAnimation;
806 WebPoint m_lastWheelPosition;
807 WebPoint m_lastWheelGlobalPosition;
811 } // namespace WebKit