Index: webkit/api/src/WebViewImpl.h |
=================================================================== |
--- webkit/api/src/WebViewImpl.h (revision 30320) |
+++ webkit/api/src/WebViewImpl.h (working copy) |
@@ -1,26 +1,52 @@ |
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
+/* |
+ * Copyright (C) 2009 Google Inc. All rights reserved. |
+ * |
+ * Redistribution and use in source and binary forms, with or without |
+ * modification, are permitted provided that the following conditions are |
+ * met: |
+ * |
+ * * Redistributions of source code must retain the above copyright |
+ * notice, this list of conditions and the following disclaimer. |
+ * * Redistributions in binary form must reproduce the above |
+ * copyright notice, this list of conditions and the following disclaimer |
+ * in the documentation and/or other materials provided with the |
+ * distribution. |
+ * * Neither the name of Google Inc. nor the names of its |
+ * contributors may be used to endorse or promote products derived from |
+ * this software without specific prior written permission. |
+ * |
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ */ |
-#ifndef WEBKIT_GLUE_WEBVIEW_IMPL_H_ |
-#define WEBKIT_GLUE_WEBVIEW_IMPL_H_ |
+#ifndef WebViewImpl_h |
+#define WebViewImpl_h |
+#include "BackForwardListClientImpl.h" |
+#include "ChromeClientImpl.h" |
+#include "ContextMenuClientImpl.h" |
+#include "DragClientImpl.h" |
+#include "EditorClientImpl.h" |
+#include "InspectorClientImpl.h" |
+#include "NotificationPresenterImpl.h" |
+// FIXME: remove this relative path once consumers from glue are removed. |
+#include "../public/WebNavigationPolicy.h" |
+#include "../public/WebPoint.h" |
+#include "../public/WebSize.h" |
+#include "../public/WebString.h" |
+#include "../public/WebView.h" |
#include <wtf/OwnPtr.h> |
#include <wtf/RefCounted.h> |
-#include "webkit/api/public/WebPoint.h" |
-#include "webkit/api/public/WebSize.h" |
-#include "webkit/api/public/WebString.h" |
-#include "webkit/api/public/WebView.h" |
-#include "webkit/api/src/BackForwardListClientImpl.h" |
-#include "webkit/api/src/ChromeClientImpl.h" |
-#include "webkit/api/src/ContextMenuClientImpl.h" |
-#include "webkit/api/src/DragClientImpl.h" |
-#include "webkit/api/src/EditorClientImpl.h" |
-#include "webkit/api/src/InspectorClientImpl.h" |
-#include "webkit/api/src/NotificationPresenterImpl.h" |
-#include "webkit/glue/webframe_impl.h" |
- |
namespace WebCore { |
class ChromiumDataObject; |
class Frame; |
@@ -35,367 +61,359 @@ |
class Widget; |
} |
+class WebDevToolsAgentImpl; |
+ |
namespace WebKit { |
+class AutocompletePopupMenuClient; |
class ContextMenuClientImpl; |
class WebAccessibilityObject; |
+class WebFrameImpl; |
class WebKeyboardEvent; |
class WebMouseEvent; |
class WebMouseWheelEvent; |
class WebSettingsImpl; |
-} |
-namespace webkit_glue { |
-class ImageResourceFetcher; |
-} |
+class WebViewImpl : public WebView, public RefCounted<WebViewImpl> { |
+public: |
+ // WebWidget methods: |
+ virtual void close(); |
+ virtual WebSize size() { return m_size; } |
+ virtual void resize(const WebSize&); |
+ virtual void layout(); |
+ virtual void paint(WebCanvas*, const WebRect&); |
+ virtual bool handleInputEvent(const WebInputEvent&); |
+ virtual void mouseCaptureLost(); |
+ virtual void setFocus(bool enable); |
+ virtual bool handleCompositionEvent(WebCompositionCommand command, |
+ int cursorPosition, |
+ int targetStart, |
+ int targetEnd, |
+ const WebString& text); |
+ virtual bool queryCompositionStatus(bool* enabled, |
+ WebRect* caretRect); |
+ virtual void setTextDirection(WebTextDirection direction); |
-class AutocompletePopupMenuClient; |
-class WebHistoryItemImpl; |
-class WebDevToolsAgentImpl; |
+ // WebView methods: |
+ virtual void initializeMainFrame(WebFrameClient*); |
+ virtual WebSettings* settings(); |
+ virtual WebString pageEncoding() const; |
+ virtual void setPageEncoding(const WebString& encoding); |
+ virtual bool isTransparent() const; |
+ virtual void setIsTransparent(bool value); |
+ virtual bool tabsToLinks() const; |
+ virtual void setTabsToLinks(bool value); |
+ virtual bool tabKeyCyclesThroughElements() const; |
+ virtual void setTabKeyCyclesThroughElements(bool value); |
+ virtual bool isActive() const; |
+ virtual void setIsActive(bool value); |
+ virtual bool dispatchBeforeUnloadEvent(); |
+ virtual void dispatchUnloadEvent(); |
+ virtual WebFrame* mainFrame(); |
+ virtual WebFrame* findFrameByName( |
+ const WebString& name, WebFrame* relativeToFrame); |
+ virtual WebFrame* focusedFrame(); |
+ virtual void setFocusedFrame(WebFrame* frame); |
+ virtual void setInitialFocus(bool reverse); |
+ virtual void clearFocusedNode(); |
+ virtual void zoomIn(bool textOnly); |
+ virtual void zoomOut(bool textOnly); |
+ virtual void zoomDefault(); |
+ virtual void performMediaPlayerAction( |
+ const WebMediaPlayerAction& action, |
+ const WebPoint& location); |
+ virtual void copyImageAt(const WebPoint& point); |
+ virtual void dragSourceEndedAt( |
+ const WebPoint& clientPoint, |
+ const WebPoint& screenPoint, |
+ WebDragOperation operation); |
+ virtual void dragSourceMovedTo( |
+ const WebPoint& clientPoint, |
+ const WebPoint& screenPoint); |
+ virtual void dragSourceSystemDragEnded(); |
+ virtual WebDragOperation dragTargetDragEnter( |
+ const WebDragData& dragData, int identity, |
+ const WebPoint& clientPoint, |
+ const WebPoint& screenPoint, |
+ WebDragOperationsMask operationsAllowed); |
+ virtual WebDragOperation dragTargetDragOver( |
+ const WebPoint& clientPoint, |
+ const WebPoint& screenPoint, |
+ WebDragOperationsMask operationsAllowed); |
+ virtual void dragTargetDragLeave(); |
+ virtual void dragTargetDrop( |
+ const WebPoint& clientPoint, |
+ const WebPoint& screenPoint); |
+ virtual int dragIdentity(); |
+ virtual bool setDropEffect(bool accept); |
+ virtual void inspectElementAt(const WebPoint& point); |
+ virtual WebString inspectorSettings() const; |
+ virtual void setInspectorSettings(const WebString& settings); |
+ virtual WebDevToolsAgent* devToolsAgent(); |
+ virtual WebAccessibilityObject accessibilityObject(); |
+ virtual void applyAutofillSuggestions( |
+ const WebNode&, |
+ const WebVector<WebString>& suggestions, |
+ int defaultSuggestionIndex); |
+ virtual void hideAutofillPopup(); |
-class WebViewImpl : public WebKit::WebView, public RefCounted<WebViewImpl> { |
- public: |
- // WebWidget methods: |
- virtual void close(); |
- virtual WebKit::WebSize size() { return size_; } |
- virtual void resize(const WebKit::WebSize& new_size); |
- virtual void layout(); |
- virtual void paint(WebKit::WebCanvas* canvas, |
- const WebKit::WebRect& rect); |
- virtual bool handleInputEvent(const WebKit::WebInputEvent& input_event); |
- virtual void mouseCaptureLost(); |
- virtual void setFocus(bool enable); |
- virtual bool handleCompositionEvent(WebKit::WebCompositionCommand command, |
- int cursor_position, |
- int target_start, |
- int target_end, |
- const WebKit::WebString& text); |
- virtual bool queryCompositionStatus(bool* enabled, |
- WebKit::WebRect* caret_rect); |
- virtual void setTextDirection(WebKit::WebTextDirection direction); |
+ // WebViewImpl |
- // WebView methods: |
- virtual void initializeMainFrame(WebKit::WebFrameClient*); |
- virtual WebKit::WebSettings* settings(); |
- virtual WebKit::WebString pageEncoding() const; |
- virtual void setPageEncoding(const WebKit::WebString& encoding); |
- virtual bool isTransparent() const; |
- virtual void setIsTransparent(bool value); |
- virtual bool tabsToLinks() const; |
- virtual void setTabsToLinks(bool value); |
- virtual bool tabKeyCyclesThroughElements() const; |
- virtual void setTabKeyCyclesThroughElements(bool value); |
- virtual bool isActive() const; |
- virtual void setIsActive(bool value); |
- virtual bool dispatchBeforeUnloadEvent(); |
- virtual void dispatchUnloadEvent(); |
- virtual WebKit::WebFrame* mainFrame(); |
- virtual WebKit::WebFrame* findFrameByName( |
- const WebKit::WebString& name, WebKit::WebFrame* relative_to_frame); |
- virtual WebKit::WebFrame* focusedFrame(); |
- virtual void setFocusedFrame(WebKit::WebFrame* frame); |
- virtual void setInitialFocus(bool reverse); |
- virtual void clearFocusedNode(); |
- virtual void zoomIn(bool text_only); |
- virtual void zoomOut(bool text_only); |
- virtual void zoomDefault(); |
- virtual void performMediaPlayerAction( |
- const WebKit::WebMediaPlayerAction& action, |
- const WebKit::WebPoint& location); |
- virtual void copyImageAt(const WebKit::WebPoint& point); |
- virtual void dragSourceEndedAt( |
- const WebKit::WebPoint& client_point, |
- const WebKit::WebPoint& screen_point, |
- WebKit::WebDragOperation operation); |
- virtual void dragSourceMovedTo( |
- const WebKit::WebPoint& client_point, |
- const WebKit::WebPoint& screen_point); |
- virtual void dragSourceSystemDragEnded(); |
- virtual WebKit::WebDragOperation dragTargetDragEnter( |
- const WebKit::WebDragData& drag_data, int identity, |
- const WebKit::WebPoint& client_point, |
- const WebKit::WebPoint& screen_point, |
- WebKit::WebDragOperationsMask operations_allowed); |
- virtual WebKit::WebDragOperation dragTargetDragOver( |
- const WebKit::WebPoint& client_point, |
- const WebKit::WebPoint& screen_point, |
- WebKit::WebDragOperationsMask operations_allowed); |
- virtual void dragTargetDragLeave(); |
- virtual void dragTargetDrop( |
- const WebKit::WebPoint& client_point, |
- const WebKit::WebPoint& screen_point); |
- virtual int dragIdentity(); |
- virtual bool setDropEffect(bool accept); |
- virtual void inspectElementAt(const WebKit::WebPoint& point); |
- virtual WebKit::WebString inspectorSettings() const; |
- virtual void setInspectorSettings(const WebKit::WebString& settings); |
- virtual WebKit::WebDevToolsAgent* devToolsAgent(); |
- virtual WebKit::WebAccessibilityObject accessibilityObject(); |
- virtual void applyAutofillSuggestions( |
- const WebKit::WebNode&, |
- const WebKit::WebVector<WebKit::WebString>& suggestions, |
- int defaultSuggestionIndex); |
- virtual void hideAutofillPopup(); |
+ void setIgnoreInputEvents(bool newValue); |
+ WebDevToolsAgentImpl* devToolsAgentImpl(); |
- // WebViewImpl |
+ const WebPoint& lastMouseDownPoint() const |
+ { |
+ return m_lastMouseDownPoint; |
+ } |
- void SetIgnoreInputEvents(bool new_value); |
- WebDevToolsAgentImpl* GetWebDevToolsAgentImpl(); |
+ WebCore::Frame* focusedWebCoreFrame(); |
- const WebKit::WebPoint& last_mouse_down_point() const { |
- return last_mouse_down_point_; |
- } |
+ // Returns the currently focused Node or null if no node has focus. |
+ WebCore::Node* focusedWebCoreNode(); |
- WebCore::Frame* GetFocusedWebCoreFrame(); |
+ static WebViewImpl* fromPage(WebCore::Page*); |
- // Returns the currently focused Node or NULL if no node has focus. |
- WebCore::Node* GetFocusedNode(); |
+ WebViewClient* client() |
+ { |
+ return m_client; |
+ } |
- static WebViewImpl* FromPage(WebCore::Page* page); |
+ // Returns the page object associated with this view. This may be null when |
+ // the page is shutting down, but will be valid at all other times. |
+ WebCore::Page* page() const |
+ { |
+ return m_page.get(); |
+ } |
- WebKit::WebViewClient* client() { |
- return client_; |
- } |
+ WebCore::RenderTheme* theme() const; |
- // Returns the page object associated with this view. This may be NULL when |
- // the page is shutting down, but will be valid at all other times. |
- WebCore::Page* page() const { |
- return page_.get(); |
- } |
+ // Returns the main frame associated with this view. This may be null when |
+ // the page is shutting down, but will be valid at all other times. |
+ WebFrameImpl* mainFrameImpl(); |
- WebCore::RenderTheme* theme() const; |
+ // History related methods: |
+ void setCurrentHistoryItem(WebCore::HistoryItem*); |
+ WebCore::HistoryItem* previousHistoryItem(); |
+ void observeNewNavigation(); |
- // Returns the main frame associated with this view. This may be NULL when |
- // the page is shutting down, but will be valid at all other times. |
- WebFrameImpl* main_frame() { |
- return page_.get() ? WebFrameImpl::FromFrame(page_->mainFrame()) : NULL; |
- } |
+ // Event related methods: |
+ void mouseMove(const WebMouseEvent&); |
+ void mouseLeave(const WebMouseEvent&); |
+ void mouseDown(const WebMouseEvent&); |
+ void mouseUp(const WebMouseEvent&); |
+ void mouseContextMenu(const WebMouseEvent&); |
+ void mouseDoubleClick(const WebMouseEvent&); |
+ void mouseWheel(const WebMouseWheelEvent&); |
+ bool keyEvent(const WebKeyboardEvent&); |
+ bool charEvent(const WebKeyboardEvent&); |
- // History related methods: |
- void SetCurrentHistoryItem(WebCore::HistoryItem* item); |
- WebCore::HistoryItem* GetPreviousHistoryItem(); |
- void ObserveNewNavigation(); |
+ // Handles context menu events orignated via the the keyboard. These |
+ // include the VK_APPS virtual key and the Shift+F10 combine. Code is |
+ // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM |
+ // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only |
+ // significant change in this function is the code to convert from a |
+ // Keyboard event to the Right Mouse button down event. |
+ bool sendContextMenuEvent(const WebKeyboardEvent&); |
- // Event related methods: |
- void MouseMove(const WebKit::WebMouseEvent& mouse_event); |
- void MouseLeave(const WebKit::WebMouseEvent& mouse_event); |
- void MouseDown(const WebKit::WebMouseEvent& mouse_event); |
- void MouseUp(const WebKit::WebMouseEvent& mouse_event); |
- void MouseContextMenu(const WebKit::WebMouseEvent& mouse_event); |
- void MouseDoubleClick(const WebKit::WebMouseEvent& mouse_event); |
- void MouseWheel(const WebKit::WebMouseWheelEvent& wheel_event); |
- bool KeyEvent(const WebKit::WebKeyboardEvent& key_event); |
- bool CharEvent(const WebKit::WebKeyboardEvent& key_event); |
+ // Notifies the WebView that a load has been committed. isNewNavigation |
+ // will be true if a new session history item should be created for that |
+ // load. |
+ void didCommitLoad(bool* isNewNavigation); |
- // Handles context menu events orignated via the the keyboard. These |
- // include the VK_APPS virtual key and the Shift+F10 combine. |
- // Code is based on the Webkit function |
- // bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) in |
- // webkit\webkit\win\WebView.cpp. The only significant change in this |
- // function is the code to convert from a Keyboard event to the Right |
- // Mouse button down event. |
- bool SendContextMenuEvent(const WebKit::WebKeyboardEvent& event); |
+ bool contextMenuAllowed() const |
+ { |
+ return m_contextMenuAllowed; |
+ } |
- // Notifies the WebView that a load has been committed. |
- // is_new_navigation will be true if a new session history item should be |
- // created for that load. |
- void DidCommitLoad(bool* is_new_navigation); |
+ // Set the disposition for how this webview is to be initially shown. |
+ void setInitialNavigationPolicy(WebNavigationPolicy policy) |
+ { |
+ m_initialNavigationPolicy = policy; |
+ } |
+ WebNavigationPolicy initialNavigationPolicy() const |
+ { |
+ return m_initialNavigationPolicy; |
+ } |
- bool context_menu_allowed() const { |
- return context_menu_allowed_; |
- } |
+ // Determines whether a page should e.g. be opened in a background tab. |
+ // Returns false if it has no opinion, in which case it doesn't set *policy. |
+ static bool navigationPolicyFromMouseEvent( |
+ unsigned short button, |
+ bool ctrl, |
+ bool shift, |
+ bool alt, |
+ bool meta, |
+ WebNavigationPolicy*); |
- // Set the disposition for how this webview is to be initially shown. |
- void set_initial_navigation_policy(WebKit::WebNavigationPolicy policy) { |
- initial_navigation_policy_ = policy; |
- } |
- WebKit::WebNavigationPolicy initial_navigation_policy() const { |
- return initial_navigation_policy_; |
- } |
+ // Start a system drag and drop operation. |
+ void startDragging( |
+ const WebPoint& eventPos, |
+ const WebDragData& dragData, |
+ WebDragOperationsMask dragSourceOperationMask); |
- // Determines whether a page should e.g. be opened in a background tab. |
- // Returns false if it has no opinion, in which case it doesn't set *policy. |
- static bool NavigationPolicyFromMouseEvent( |
- unsigned short button, |
- bool ctrl, |
- bool shift, |
- bool alt, |
- bool meta, |
- WebKit::WebNavigationPolicy* policy); |
+ // Hides the autocomplete popup if it is showing. |
+ void hideAutoCompletePopup(); |
+ void autoCompletePopupDidHide(); |
- // Start a system drag and drop operation. |
- void StartDragging( |
- const WebKit::WebPoint& event_pos, |
- const WebKit::WebDragData& drag_data, |
- WebKit::WebDragOperationsMask drag_source_operation_mask); |
- |
- // Hides the autocomplete popup if it is showing. |
- void HideAutoCompletePopup(); |
- void AutoCompletePopupDidHide(); |
- |
#if ENABLE(NOTIFICATIONS) |
- // Returns the provider of desktop notifications. |
- WebKit::NotificationPresenterImpl* GetNotificationPresenter(); |
+ // Returns the provider of desktop notifications. |
+ NotificationPresenterImpl* notificationPresenterImpl(); |
#endif |
- // Tries to scroll a frame or any parent of a frame. Returns true if the view |
- // was scrolled. |
- bool PropagateScroll(WebCore::ScrollDirection scroll_direction, |
- WebCore::ScrollGranularity scroll_granularity); |
+ // Tries to scroll a frame or any parent of a frame. Returns true if the view |
+ // was scrolled. |
+ bool propagateScroll(WebCore::ScrollDirection, WebCore::ScrollGranularity); |
- protected: |
- friend class WebKit::WebView; // So WebView::Create can call our constructor |
- friend class WTF::RefCounted<WebViewImpl>; |
+ // HACK: currentInputEvent() is for ChromeClientImpl::show(), until we can |
+ // fix WebKit to pass enough information up into ChromeClient::show() so we |
+ // can decide if the window.open event was caused by a middle-mouse click |
+ static const WebInputEvent* currentInputEvent() |
+ { |
+ return m_currentInputEvent; |
+ } |
- WebViewImpl(WebKit::WebViewClient* client); |
- ~WebViewImpl(); |
+private: |
+ friend class WebView; // So WebView::Create can call our constructor |
+ friend class WTF::RefCounted<WebViewImpl>; |
- void ModifySelection(uint32 message, |
- WebCore::Frame* frame, |
- const WebCore::PlatformKeyboardEvent& e); |
+ WebViewImpl(WebViewClient* client); |
+ ~WebViewImpl(); |
- WebKit::WebViewClient* client_; |
+ void modifySelection(uint32 message, WebCore::Frame*, const WebCore::PlatformKeyboardEvent&); |
- WebKit::BackForwardListClientImpl back_forward_list_client_impl_; |
- WebKit::ChromeClientImpl chrome_client_impl_; |
- WebKit::ContextMenuClientImpl context_menu_client_impl_; |
- WebKit::DragClientImpl drag_client_impl_; |
- WebKit::EditorClientImpl editor_client_impl_; |
- WebKit::InspectorClientImpl inspector_client_impl_; |
+ // Returns true if the event was actually processed. |
+ bool keyEventDefault(const WebKeyboardEvent&); |
- WebKit::WebSize size_; |
+ // Returns true if the autocomple has consumed the event. |
+ bool autocompleteHandleKeyEvent(const WebKeyboardEvent&); |
- WebKit::WebPoint last_mouse_position_; |
- OwnPtr<WebCore::Page> page_; |
+ // Repaints the autofill popup. Should be called when the suggestions have |
+ // changed. Note that this should only be called when the autofill popup is |
+ // showing. |
+ void refreshAutofillPopup(); |
- // This flag is set when a new navigation is detected. It is used to satisfy |
- // the corresponding argument to WebFrameClient::didCommitProvisionalLoad. |
- bool observed_new_navigation_; |
-#ifndef NDEBUG |
- // Used to assert that the new navigation we observed is the same navigation |
- // when we make use of observed_new_navigation_. |
- const WebCore::DocumentLoader* new_navigation_loader_; |
-#endif |
+ // Returns true if the view was scrolled. |
+ bool scrollViewWithKeyboard(int keyCode, int modifiers); |
- // An object that can be used to manipulate page_->settings() without linking |
- // against WebCore. This is lazily allocated the first time GetWebSettings() |
- // is called. |
- OwnPtr<WebKit::WebSettingsImpl> web_settings_; |
+ // Converts |pos| from window coordinates to contents coordinates and gets |
+ // the HitTestResult for it. |
+ WebCore::HitTestResult hitTestResultForWindowPos(const WebCore::IntPoint&); |
- // A copy of the web drop data object we received from the browser. |
- RefPtr<WebCore::ChromiumDataObject> current_drag_data_; |
+ WebViewClient* m_client; |
- private: |
- // Returns true if the event was actually processed. |
- bool KeyEventDefault(const WebKit::WebKeyboardEvent& event); |
+ BackForwardListClientImpl m_backForwardListClientImpl; |
+ ChromeClientImpl m_chromeClientImpl; |
+ ContextMenuClientImpl m_contextMenuClientImpl; |
+ DragClientImpl m_dragClientImpl; |
+ EditorClientImpl m_editorClientImpl; |
+ InspectorClientImpl m_inspectorClientImpl; |
- // Returns true if the autocomple has consumed the event. |
- bool AutocompleteHandleKeyEvent(const WebKit::WebKeyboardEvent& event); |
+ WebSize m_size; |
- // Repaints the autofill popup. Should be called when the suggestions have |
- // changed. Note that this should only be called when the autofill popup is |
- // showing. |
- void RefreshAutofillPopup(); |
+ WebPoint m_lastMousePosition; |
+ OwnPtr<WebCore::Page> m_page; |
- // Returns true if the view was scrolled. |
- bool ScrollViewWithKeyboard(int key_code, int modifiers); |
+ // This flag is set when a new navigation is detected. It is used to satisfy |
+ // the corresponding argument to WebFrameClient::didCommitProvisionalLoad. |
+ bool m_observedNewNavigation; |
+#ifndef NDEBUG |
+ // Used to assert that the new navigation we observed is the same navigation |
+ // when we make use of m_observedNewNavigation. |
+ const WebCore::DocumentLoader* m_newNavigationLoader; |
+#endif |
- // Converts |pos| from window coordinates to contents coordinates and gets |
- // the HitTestResult for it. |
- WebCore::HitTestResult HitTestResultForWindowPos( |
- const WebCore::IntPoint& pos); |
+ // An object that can be used to manipulate m_page->settings() without linking |
+ // against WebCore. This is lazily allocated the first time GetWebSettings() |
+ // is called. |
+ OwnPtr<WebSettingsImpl> m_webSettings; |
- // The point relative to the client area where the mouse was last pressed |
- // down. This is used by the drag client to determine what was under the |
- // mouse when the drag was initiated. We need to track this here in |
- // WebViewImpl since DragClient::startDrag does not pass the position the |
- // mouse was at when the drag was initiated, only the current point, which |
- // can be misleading as it is usually not over the element the user actually |
- // dragged by the time a drag is initiated. |
- WebKit::WebPoint last_mouse_down_point_; |
+ // A copy of the web drop data object we received from the browser. |
+ RefPtr<WebCore::ChromiumDataObject> m_currentDragData; |
- // Keeps track of the current text zoom level. 0 means no zoom, positive |
- // values mean larger text, negative numbers mean smaller. |
- int zoom_level_; |
+ // The point relative to the client area where the mouse was last pressed |
+ // down. This is used by the drag client to determine what was under the |
+ // mouse when the drag was initiated. We need to track this here in |
+ // WebViewImpl since DragClient::startDrag does not pass the position the |
+ // mouse was at when the drag was initiated, only the current point, which |
+ // can be misleading as it is usually not over the element the user actually |
+ // dragged by the time a drag is initiated. |
+ WebPoint m_lastMouseDownPoint; |
- bool context_menu_allowed_; |
+ // Keeps track of the current text zoom level. 0 means no zoom, positive |
+ // values mean larger text, negative numbers mean smaller. |
+ int m_zoomLevel; |
- bool doing_drag_and_drop_; |
+ bool m_contextMenuAllowed; |
- bool ignore_input_events_; |
+ bool m_doingDragAndDrop; |
- // Webkit expects keyPress events to be suppressed if the associated keyDown |
- // event was handled. Safari implements this behavior by peeking out the |
- // associated WM_CHAR event if the keydown was handled. We emulate |
- // this behavior by setting this flag if the keyDown was handled. |
- bool suppress_next_keypress_event_; |
+ bool m_ignoreInputEvents; |
- // The policy for how this webview is to be initially shown. |
- WebKit::WebNavigationPolicy initial_navigation_policy_; |
+ // Webkit expects keyPress events to be suppressed if the associated keyDown |
+ // event was handled. Safari implements this behavior by peeking out the |
+ // associated WM_CHAR event if the keydown was handled. We emulate |
+ // this behavior by setting this flag if the keyDown was handled. |
+ bool m_suppressNextKeypressEvent; |
- // Represents whether or not this object should process incoming IME events. |
- bool ime_accept_events_; |
+ // The policy for how this webview is to be initially shown. |
+ WebNavigationPolicy m_initialNavigationPolicy; |
- // True while dispatching system drag and drop events to drag/drop targets |
- // within this WebView. |
- bool drag_target_dispatch_; |
+ // Represents whether or not this object should process incoming IME events. |
+ bool m_imeAcceptEvents; |
- // Valid when drag_target_dispatch_ is true; the identity of the drag data |
- // copied from the WebDropData object sent from the browser process. |
- int32 drag_identity_; |
+ // True while dispatching system drag and drop events to drag/drop targets |
+ // within this WebView. |
+ bool m_dragTargetDispatch; |
- // Valid when drag_target_dispatch_ is true. Used to override the default |
- // browser drop effect with the effects "none" or "copy". |
- enum DragTargetDropEffect { |
- DROP_EFFECT_DEFAULT = -1, |
- DROP_EFFECT_NONE, |
- DROP_EFFECT_COPY |
- } drop_effect_; |
+ // Valid when m_dragTargetDispatch is true; the identity of the drag data |
+ // copied from the WebDropData object sent from the browser process. |
+ int32 m_dragIdentity; |
- // The available drag operations (copy, move link...) allowed by the source. |
- WebKit::WebDragOperation operations_allowed_; |
+ // Valid when m_dragTargetDispatch is true. Used to override the default |
+ // browser drop effect with the effects "none" or "copy". |
+ enum DragTargetDropEffect { |
+ DropEffectDefault = -1, |
+ DropEffectNone, |
+ DropEffectCopy |
+ } m_dropEffect; |
- // The current drag operation as negotiated by the source and destination. |
- // When not equal to DragOperationNone, the drag data can be dropped onto the |
- // current drop target in this WebView (the drop target can accept the drop). |
- WebKit::WebDragOperation drag_operation_; |
+ // The available drag operations (copy, move link...) allowed by the source. |
+ WebDragOperation m_operationsAllowed; |
- // The autocomplete popup. Kept around and reused every-time new suggestions |
- // should be shown. |
- RefPtr<WebCore::PopupContainer> autocomplete_popup_; |
+ // The current drag operation as negotiated by the source and destination. |
+ // When not equal to DragOperationNone, the drag data can be dropped onto the |
+ // current drop target in this WebView (the drop target can accept the drop). |
+ WebDragOperation m_dragOperation; |
- // Whether the autocomplete popup is currently showing. |
- bool autocomplete_popup_showing_; |
+ // The autocomplete popup. Kept around and reused every-time new suggestions |
+ // should be shown. |
+ RefPtr<WebCore::PopupContainer> m_autocompletePopup; |
- // The autocomplete client. |
- OwnPtr<AutocompletePopupMenuClient> autocomplete_popup_client_; |
+ // Whether the autocomplete popup is currently showing. |
+ bool m_autocompletePopupShowing; |
- OwnPtr<WebDevToolsAgentImpl> devtools_agent_; |
+ // The autocomplete client. |
+ OwnPtr<AutocompletePopupMenuClient> m_autocompletePopupClient; |
- // Whether the webview is rendering transparently. |
- bool is_transparent_; |
+ OwnPtr<WebDevToolsAgentImpl> m_devToolsAgent; |
- // Whether the user can press tab to focus links. |
- bool tabs_to_links_; |
+ // Whether the webview is rendering transparently. |
+ bool m_isTransparent; |
- // Inspector settings. |
- WebKit::WebString inspector_settings_; |
+ // Whether the user can press tab to focus links. |
+ bool m_tabsToLinks; |
+ // Inspector settings. |
+ WebString m_inspectorSettings; |
+ |
#if ENABLE(NOTIFICATIONS) |
- // The provider of desktop notifications; |
- WebKit::NotificationPresenterImpl notification_presenter_; |
+ // The provider of desktop notifications; |
+ NotificationPresenterImpl m_notificationPresenter; |
#endif |
- // HACK: current_input_event is for ChromeClientImpl::show(), until we can fix |
- // WebKit to pass enough information up into ChromeClient::show() so we can |
- // decide if the window.open event was caused by a middle-mouse click |
- public: |
- static const WebKit::WebInputEvent* current_input_event() { |
- return g_current_input_event; |
- } |
- private: |
- static const WebKit::WebInputEvent* g_current_input_event; |
- |
- DISALLOW_COPY_AND_ASSIGN(WebViewImpl); |
+ static const WebInputEvent* m_currentInputEvent; |
}; |
-#endif // WEBKIT_GLUE_WEBVIEW_IMPL_H_ |
+} // namespace WebKit |
+ |
+#endif |