diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 05:11:03 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 05:11:03 +0000 |
commit | 50ae00ef9da3304a68d9f811380572a5e2ed03cb (patch) | |
tree | e58480c200f54468e61635a134cb6b51fb7809df /webkit | |
parent | a9e8a092db75a1aff5e03d29215390ade65dec1e (diff) | |
download | chromium_src-50ae00ef9da3304a68d9f811380572a5e2ed03cb.zip chromium_src-50ae00ef9da3304a68d9f811380572a5e2ed03cb.tar.gz chromium_src-50ae00ef9da3304a68d9f811380572a5e2ed03cb.tar.bz2 |
Delete glue/webview{_delegate}.h
R=dglazkov
BUG=10033
TEST=none
Review URL: http://codereview.chromium.org/293001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
67 files changed, 206 insertions, 265 deletions
diff --git a/webkit/api/public/WebFrame.h b/webkit/api/public/WebFrame.h index 1306b97..04c862d 100644 --- a/webkit/api/public/WebFrame.h +++ b/webkit/api/public/WebFrame.h @@ -34,7 +34,6 @@ #include "WebCanvas.h" #include "WebURL.h" -class WebView; // FIXME: Move into the WebKit namespace. struct NPObject; #if WEBKIT_USING_V8 @@ -54,6 +53,7 @@ namespace WebKit { class WebString; class WebURL; class WebURLRequest; + class WebView; struct WebConsoleMessage; struct WebFindOptions; struct WebRect; @@ -123,7 +123,7 @@ namespace WebKit { // Hierarchy ---------------------------------------------------------- // Returns the containing view. - virtual ::WebView* view() const = 0; + virtual WebView* view() const = 0; // Returns the frame that opened this frame or 0 if there is none. virtual WebFrame* opener() const = 0; diff --git a/webkit/api/public/WebView.h b/webkit/api/public/WebView.h index 328d03a..09185c4 100644 --- a/webkit/api/public/WebView.h +++ b/webkit/api/public/WebView.h @@ -52,13 +52,15 @@ namespace WebKit { public: // Initialization ------------------------------------------------------ - // FIXME enable this once WebViewDelegate has been eliminated. - //WEBKIT_API WebView* create(WebViewClient*); + // Creates a WebView that is NOT yet initialized. You will need to + // call initializeMainFrame to finish the initialization. It is valid + // to pass a null WebViewClient pointer. + WEBKIT_API static WebView* create(WebViewClient*); // After creating a WebView, you should immediately call this method. // You can optionally modify the settings before calling this method. // The WebFrameClient will receive events for the main frame and any - // child frames. + // child frames. It is valid to pass a null WebFrameClient pointer. virtual void initializeMainFrame(WebFrameClient*) = 0; @@ -225,10 +227,16 @@ namespace WebKit { virtual void hideAutofillPopup() = 0; - // FIXME what about: - // GetDelegate - // AutofillSuggestionsForNode - // HideAutofillPopup + // Visited link state -------------------------------------------------- + + // Tells all WebView instances to update the visited link state for the + // specified hash. + WEBKIT_API static void updateVisitedLinkState(unsigned long long hash); + + // Tells all WebView instances to update the visited state for all + // their links. + WEBKIT_API static void resetVisitedLinkState(); + protected: ~WebView() {} diff --git a/webkit/api/public/WebViewClient.h b/webkit/api/public/WebViewClient.h index 054a747..b4a1e2d 100644 --- a/webkit/api/public/WebViewClient.h +++ b/webkit/api/public/WebViewClient.h @@ -38,8 +38,6 @@ #include "WebTextDirection.h" #include "WebWidgetClient.h" -class WebView; // FIXME: Move into the WebKit namespace. - namespace WebKit { class WebAccessibilityObject; class WebDevToolsAgentClient; @@ -51,6 +49,7 @@ namespace WebKit { class WebRange; class WebString; class WebURL; + class WebView; class WebWidget; struct WebConsoleMessage; struct WebContextMenuData; @@ -272,15 +271,8 @@ namespace WebKit { virtual void removeAutofillSuggestions(const WebString& name, const WebString& value) = 0; - - // FIXME need to something for: - // OnPasswordFormsSeen - // OnAutofillFormSubmitted - // QueryFormFieldAutofill - // RemoveStoredAutofillEntry - // ShowModalHTMLDialog <-- we should be able to kill this - // GetWebDevToolsAgentDelegate - // WasOpenedByUserGesture + protected: + ~WebViewClient() { } }; } // namespace WebKit diff --git a/webkit/glue/back_forward_list_client_impl.cc b/webkit/glue/back_forward_list_client_impl.cc index 0155009..c6a0661 100644 --- a/webkit/glue/back_forward_list_client_impl.cc +++ b/webkit/glue/back_forward_list_client_impl.cc @@ -7,6 +7,7 @@ #include "HistoryItem.h" #undef LOG +#include "webkit/api/public/WebViewClient.h" #include "webkit/glue/back_forward_list_client_impl.h" #include "webkit/glue/webview_impl.h" diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index 90c4e49..4cffba2 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -48,7 +48,6 @@ #include "webkit/glue/webframe_impl.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpopupmenu_impl.h" -#include "webkit/glue/webview_delegate.h" #include "webkit/glue/webview_impl.h" using WebCore::PopupContainer; @@ -245,28 +244,27 @@ static inline bool CurrentEventShouldCauseBackgroundTab( } void ChromeClientImpl::show() { - WebViewDelegate* delegate = webview_->delegate(); - if (delegate) { - // If our default configuration was modified by a script or wasn't - // created by a user gesture, then show as a popup. Else, let this - // new window be opened as a toplevel window. - // - bool as_popup = - !toolbars_visible_ || - !statusbar_visible_ || - !scrollbars_visible_ || - !menubar_visible_ || - !resizable_; - - WebNavigationPolicy policy = WebKit::WebNavigationPolicyNewForegroundTab; - if (as_popup) - policy = WebKit::WebNavigationPolicyNewPopup; - if (CurrentEventShouldCauseBackgroundTab( - WebViewImpl::current_input_event())) - policy = WebKit::WebNavigationPolicyNewBackgroundTab; - - delegate->show(policy); - } + if (!webview_->client()) + return; + + // If our default configuration was modified by a script or wasn't + // created by a user gesture, then show as a popup. Else, let this + // new window be opened as a toplevel window. + bool as_popup = + !toolbars_visible_ || + !statusbar_visible_ || + !scrollbars_visible_ || + !menubar_visible_ || + !resizable_; + + WebNavigationPolicy policy = WebKit::WebNavigationPolicyNewForegroundTab; + if (as_popup) + policy = WebKit::WebNavigationPolicyNewPopup; + if (CurrentEventShouldCauseBackgroundTab( + WebViewImpl::current_input_event())) + policy = WebKit::WebNavigationPolicyNewBackgroundTab; + + webview_->client()->show(policy); } bool ChromeClientImpl::canRunModal() { diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc index 57f8c87..15187fe 100644 --- a/webkit/glue/context_menu_client_impl.cc +++ b/webkit/glue/context_menu_client_impl.cc @@ -28,6 +28,7 @@ #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebURLResponse.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/api/src/WebDataSourceImpl.h" #include "webkit/glue/context_menu.h" #include "webkit/glue/context_menu_client_impl.h" diff --git a/webkit/glue/context_menu_unittest.cc b/webkit/glue/context_menu_unittest.cc index 61cc229..9b00769 100644 --- a/webkit/glue/context_menu_unittest.cc +++ b/webkit/glue/context_menu_unittest.cc @@ -10,12 +10,13 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/message_loop.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_shell_test.h" using WebKit::WebInputEvent; using WebKit::WebMouseEvent; +using WebKit::WebView; // Right clicking inside on an iframe should produce a context menu class ContextMenuCapturing : public TestShellTest { diff --git a/webkit/glue/cpp_bound_class_unittest.cc b/webkit/glue/cpp_bound_class_unittest.cc index 919ffc5..5edb23d 100644 --- a/webkit/glue/cpp_bound_class_unittest.cc +++ b/webkit/glue/cpp_bound_class_unittest.cc @@ -12,9 +12,9 @@ #include "webkit/api/public/WebData.h" #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebURL.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/cpp_binding_example.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_shell_test.h" using WebKit::WebFrame; diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc index 298933d..78d9fea 100644 --- a/webkit/glue/dom_operations.cc +++ b/webkit/glue/dom_operations.cc @@ -39,6 +39,7 @@ MSVC_POP_WARNING(); using WebCore::String; using WebKit::WebFrame; +using WebKit::WebView; namespace { diff --git a/webkit/glue/dom_operations.h b/webkit/glue/dom_operations.h index 1694f4d..af188fc 100644 --- a/webkit/glue/dom_operations.h +++ b/webkit/glue/dom_operations.h @@ -18,9 +18,12 @@ class HTMLInputElement; class Node; } +namespace WebKit { +class WebView; +} + struct FormData; class WebFrameImpl; -class WebView; // A collection of operations that access the underlying WebKit DOM directly. namespace webkit_glue { @@ -47,14 +50,14 @@ struct FileUploadData { FormValueMap other_form_values; }; -bool FillFormToUploadFile(WebView* view, const FileUploadData& data); +bool FillFormToUploadFile(WebKit::WebView* view, const FileUploadData& data); // Fill in a form identified by form |data|. -bool FillForm(WebView* view, const FormData& data); +bool FillForm(WebKit::WebView* view, const FormData& data); // Fill matching password forms and trigger autocomplete in the case of multiple // matching logins. -void FillPasswordForm(WebView* view, +void FillPasswordForm(WebKit::WebView* view, const PasswordFormDomManager::FillData& data); // Structure for storage the result of getting all savable resource links @@ -86,7 +89,7 @@ struct SavableResourcesResult { // and sub-frame. After collecting all savable resource links, this function // will send those links to embedder. Return value indicates whether we get // all saved resource links successfully. -bool GetAllSavableResourceLinksForCurrentPage(WebView* view, +bool GetAllSavableResourceLinksForCurrentPage(WebKit::WebView* view, const GURL& page_url, SavableResourcesResult* savable_resources_result, const char** savable_schemes); @@ -127,12 +130,12 @@ bool ParseIconSizes(const std::wstring& text, // Gets the application info for the specified page. See the description of // WebApplicationInfo for details as to where each field comes from. -void GetApplicationInfo(WebView* view, WebApplicationInfo* app_info); +void GetApplicationInfo(WebKit::WebView* view, WebApplicationInfo* app_info); // Invokes pauseAnimationAtTime on the AnimationController associated with the // |view|s main frame. // This is used by test shell. -bool PauseAnimationAtTimeOnElementWithId(WebView* view, +bool PauseAnimationAtTimeOnElementWithId(WebKit::WebView* view, const std::string& animation_name, double time, const std::string& element_id); @@ -140,18 +143,18 @@ bool PauseAnimationAtTimeOnElementWithId(WebView* view, // Invokes pauseTransitionAtTime on the AnimationController associated with the // |view|s main frame. // This is used by test shell. -bool PauseTransitionAtTimeOnElementWithId(WebView* view, +bool PauseTransitionAtTimeOnElementWithId(WebKit::WebView* view, const std::string& property_name, double time, const std::string& element_id); // Returns true if the element with |element_id| as its id has autocomplete // on. -bool ElementDoesAutoCompleteForElementWithId(WebView* view, +bool ElementDoesAutoCompleteForElementWithId(WebKit::WebView* view, const std::string& element_id); // Returns the number of animations currently running. -int NumberOfActiveAnimations(WebView* view); +int NumberOfActiveAnimations(WebKit::WebView* view); // Returns the passed element/node casted to an HTMLInputElement if it is one, // NULL if it is not an HTMLInputElement. diff --git a/webkit/glue/dom_operations_private.h b/webkit/glue/dom_operations_private.h index 460cdcb..3173361 100644 --- a/webkit/glue/dom_operations_private.h +++ b/webkit/glue/dom_operations_private.h @@ -54,7 +54,7 @@ bool ElementHasLegalLinkAttribute(const WebCore::Element* element, const WebCore::QualifiedName& attr_name); // Get pointer of WebFrameImpl from webview according to specific URL. -WebFrameImpl* GetWebFrameImplFromWebViewForSpecificURL(WebView* view, +WebFrameImpl* GetWebFrameImplFromWebViewForSpecificURL(WebKit::WebView* view, const GURL& page_url); } // namespace webkit_glue diff --git a/webkit/glue/dom_operations_unittest.cc b/webkit/glue/dom_operations_unittest.cc index 92955da..5cfd9d3 100644 --- a/webkit/glue/dom_operations_unittest.cc +++ b/webkit/glue/dom_operations_unittest.cc @@ -7,8 +7,8 @@ #include "base/string_util.h" #include "net/base/net_util.h" #include "net/url_request/url_request_context.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/dom_operations.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_shell_test.h" diff --git a/webkit/glue/dom_serializer_unittest.cc b/webkit/glue/dom_serializer_unittest.cc index f62f01fb..67cb4e9 100644 --- a/webkit/glue/dom_serializer_unittest.cc +++ b/webkit/glue/dom_serializer_unittest.cc @@ -31,13 +31,13 @@ MSVC_POP_WARNING(); #include "net/url_request/url_request_context.h" #include "webkit/api/public/WebData.h" #include "webkit/api/public/WebURL.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/dom_operations_private.h" #include "webkit/glue/dom_serializer.h" #include "webkit/glue/dom_serializer_delegate.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/webframe_impl.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_shell_test.h" diff --git a/webkit/glue/dragclient_impl.cc b/webkit/glue/dragclient_impl.cc index cb29825..0f8ae18 100644 --- a/webkit/glue/dragclient_impl.cc +++ b/webkit/glue/dragclient_impl.cc @@ -10,9 +10,9 @@ #undef LOG #include "webkit/api/public/WebDragData.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/glue/dragclient_impl.h" #include "webkit/glue/glue_util.h" -#include "webkit/glue/webdropdata.h" #include "webkit/glue/webview_impl.h" using WebKit::WebDragData; diff --git a/webkit/glue/editor_client_impl.cc b/webkit/glue/editor_client_impl.cc index bbcadc46..c42656e 100644 --- a/webkit/glue/editor_client_impl.cc +++ b/webkit/glue/editor_client_impl.cc @@ -28,11 +28,11 @@ #include "webkit/api/public/WebNode.h" #include "webkit/api/public/WebRange.h" #include "webkit/api/public/WebTextAffinity.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/glue/autofill_form.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/editor_client_impl.h" #include "webkit/glue/glue_util.h" -#include "webkit/glue/webview.h" #include "webkit/glue/webview_impl.h" using WebKit::WebEditingAction; diff --git a/webkit/glue/iframe_redirect_unittest.cc b/webkit/glue/iframe_redirect_unittest.cc index 4475735..23d4fdb 100644 --- a/webkit/glue/iframe_redirect_unittest.cc +++ b/webkit/glue/iframe_redirect_unittest.cc @@ -15,8 +15,8 @@ #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebVector.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_shell_test.h" using WebKit::WebDataSource; diff --git a/webkit/glue/inspector_client_impl.cc b/webkit/glue/inspector_client_impl.cc index 6e58a87..604118d 100644 --- a/webkit/glue/inspector_client_impl.cc +++ b/webkit/glue/inspector_client_impl.cc @@ -22,6 +22,7 @@ MSVC_POP_WARNING(); #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebURLRequest.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/inspector_client_impl.h" #include "webkit/glue/webdevtoolsagent_impl.h" diff --git a/webkit/glue/mimetype_unittest.cc b/webkit/glue/mimetype_unittest.cc index 36a59dd..cc4b793 100644 --- a/webkit/glue/mimetype_unittest.cc +++ b/webkit/glue/mimetype_unittest.cc @@ -11,9 +11,9 @@ #include "base/string_util.h" #include "net/url_request/url_request_unittest.h" #include "webkit/api/public/WebFrame.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/unittest_test_server.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_shell_test.h" using WebKit::WebFrame; diff --git a/webkit/glue/resource_fetcher_unittest.cc b/webkit/glue/resource_fetcher_unittest.cc index dc98fc6..daa88cf 100644 --- a/webkit/glue/resource_fetcher_unittest.cc +++ b/webkit/glue/resource_fetcher_unittest.cc @@ -8,8 +8,8 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebURLResponse.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/unittest_test_server.h" -#include "webkit/glue/webview.h" #include "webkit/glue/resource_fetcher.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_shell_test.h" diff --git a/webkit/glue/webaccessibilitymanager.h b/webkit/glue/webaccessibilitymanager.h index 04c1685..2debcb7 100644 --- a/webkit/glue/webaccessibilitymanager.h +++ b/webkit/glue/webaccessibilitymanager.h @@ -9,9 +9,8 @@ namespace WebKit { class WebAccessibilityObject; -} - class WebView; +} //////////////////////////////////////////////////////////////////////////////// // @@ -35,7 +34,7 @@ class WebAccessibilityManager { // calling into WebKit's AccessibilityObject. Maintains a hashmap of the // currently active (browser side ref-count non-zero) instances. Returns true // if successful, false otherwise. - virtual bool GetAccObjInfo(WebView* view, + virtual bool GetAccObjInfo(WebKit::WebView* view, const WebAccessibility::InParams& in_params, WebAccessibility::OutParams* out_params) = 0; @@ -53,7 +52,7 @@ class WebAccessibilityManager { // initialize the root of the GlueAccessibilityObject tree with the // associated accessibility information. Returns true if successful, false // otherwise. - virtual bool InitAccObjRoot(WebView* view) = 0; + virtual bool InitAccObjRoot(WebKit::WebView* view) = 0; DISALLOW_COPY_AND_ASSIGN(WebAccessibilityManager); }; diff --git a/webkit/glue/webaccessibilitymanager_impl.cc b/webkit/glue/webaccessibilitymanager_impl.cc index be4e9a0..fde40b3 100644 --- a/webkit/glue/webaccessibilitymanager_impl.cc +++ b/webkit/glue/webaccessibilitymanager_impl.cc @@ -19,6 +19,7 @@ #include "webkit/glue/webview_impl.h" using WebKit::WebAccessibilityObject; +using WebKit::WebView; namespace webkit_glue { diff --git a/webkit/glue/webaccessibilitymanager_impl.h b/webkit/glue/webaccessibilitymanager_impl.h index a92fd21..c95ec5f 100644 --- a/webkit/glue/webaccessibilitymanager_impl.h +++ b/webkit/glue/webaccessibilitymanager_impl.h @@ -26,7 +26,8 @@ namespace webkit_glue { class WebAccessibilityManagerImpl : public WebAccessibilityManager { public: // From WebAccessibilityManager. - bool GetAccObjInfo(WebView* view, const WebAccessibility::InParams& in_params, + bool GetAccObjInfo(WebKit::WebView* view, + const WebAccessibility::InParams& in_params, WebAccessibility::OutParams* out_params); bool ClearAccObjMap(int acc_obj_id, bool clear_all); int FocusAccObj(const WebKit::WebAccessibilityObject& object); @@ -43,7 +44,7 @@ class WebAccessibilityManagerImpl : public WebAccessibilityManager { private: // From WebAccessibilityManager. - bool InitAccObjRoot(WebView* view); + bool InitAccObjRoot(WebKit::WebView* view); // Wrapper around the pointer that holds the root of the AccessibilityObject // tree, to allow the use of a scoped_refptr. diff --git a/webkit/glue/webdevtoolsclient.h b/webkit/glue/webdevtoolsclient.h index 5b1d11e..75e4c6c 100644 --- a/webkit/glue/webdevtoolsclient.h +++ b/webkit/glue/webdevtoolsclient.h @@ -8,10 +8,10 @@ #include "base/basictypes.h" class WebDevToolsClientDelegate; -class WebView; namespace WebKit { class WebString; +class WebView; } // WebDevToolsClient represents DevTools client sitting in the Glue. It provides @@ -19,7 +19,7 @@ class WebString; class WebDevToolsClient { public: static WebDevToolsClient* Create( - WebView* view, + WebKit::WebView* view, WebDevToolsClientDelegate* delegate, const WebKit::WebString& application_locale); diff --git a/webkit/glue/webdevtoolsclient_impl.cc b/webkit/glue/webdevtoolsclient_impl.cc index c5dca05..374f05d 100644 --- a/webkit/glue/webdevtoolsclient_impl.cc +++ b/webkit/glue/webdevtoolsclient_impl.cc @@ -40,6 +40,7 @@ using namespace WebCore; using WebKit::WebFrame; using WebKit::WebScriptSource; using WebKit::WebString; +using WebKit::WebView; static v8::Local<v8::String> ToV8String(const String& s) { if (s.isNull()) diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 7a18b0b..801af55 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -234,6 +234,7 @@ using WebKit::WebURLError; using WebKit::WebURLRequest; using WebKit::WebURLResponse; using WebKit::WebVector; +using WebKit::WebView; // Key for a StatsCounter tracking how many WebFrames are active. static const char* const kWebFrameActiveCount = "WebFrameActiveCount"; diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index f840df4..a5d0794 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -41,7 +41,6 @@ MSVC_PUSH_WARNING_LEVEL(0); MSVC_POP_WARNING(); class ChromePrintContext; -class WebView; class WebViewImpl; namespace gfx { @@ -62,6 +61,7 @@ struct WindowFeatures; namespace WebKit { class WebDataSourceImpl; class WebFrameClient; +class WebView; } // Implementation of WebFrame, note that this is a reference counted object. @@ -76,7 +76,7 @@ class WebFrameImpl : public WebKit::WebFrame, public RefCounted<WebFrameImpl> { virtual WebKit::WebSize contentsSize() const; virtual int contentsPreferredWidth() const; virtual bool hasVisibleContent() const; - virtual WebView* view() const; + virtual WebKit::WebView* view() const; virtual WebKit::WebFrame* opener() const; virtual WebKit::WebFrame* parent() const; virtual WebKit::WebFrame* top() const; diff --git a/webkit/glue/webframe_unittest.cc b/webkit/glue/webframe_unittest.cc index b2a71b4..1faf22f 100644 --- a/webkit/glue/webframe_unittest.cc +++ b/webkit/glue/webframe_unittest.cc @@ -8,14 +8,14 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" -#include "webkit/glue/webview.h" +#include "webkit/api/public/WebView.h" #include "webkit/tools/test_shell/test_shell_test.h" using WebKit::WebFrame; using WebKit::WebString; +using WebKit::WebView; class WebFrameTest : public TestShellTest { - public: }; TEST_F(WebFrameTest, GetContentAsPlainText) { diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index 3fe52c62..0d83c5c 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -35,6 +35,7 @@ #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebURLError.h" #include "webkit/api/public/WebVector.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/api/src/WebDataSourceImpl.h" #include "webkit/api/src/WebPluginContainerImpl.h" #include "webkit/api/src/WebPluginLoadObserver.h" diff --git a/webkit/glue/webframeloaderclient_impl.h b/webkit/glue/webframeloaderclient_impl.h index aad5d8f..fdf5de7 100644 --- a/webkit/glue/webframeloaderclient_impl.h +++ b/webkit/glue/webframeloaderclient_impl.h @@ -11,7 +11,6 @@ #include <wtf/RefPtr.h> #include "webkit/api/public/WebNavigationPolicy.h" -#include "webkit/glue/webview_delegate.h" class WebFrameImpl; diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index 2136b22..63bc486 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -56,6 +56,7 @@ using WebKit::WebFrame; using WebKit::WebHistoryItem; using WebKit::WebString; using WebKit::WebVector; +using WebKit::WebView; namespace { diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index 68040b3..d4d506a 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -21,7 +21,6 @@ class GURL; class SkBitmap; -class WebView; struct WebPluginInfo; namespace base { @@ -35,6 +34,7 @@ class PlatformCanvas; namespace WebKit { class WebFrame; class WebString; +class WebView; } namespace webkit_glue { @@ -67,7 +67,7 @@ std::wstring DumpHistoryState(const std::string& history_state, int indent, bool is_current); // Cleans up state left over from the previous test run. -void ResetBeforeTestRun(WebView* view); +void ResetBeforeTestRun(WebKit::WebView* view); // Returns the WebKit version (major.minor). std::string GetWebKitVersion(); diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc index 7b3dde924..d36f043 100644 --- a/webkit/glue/webkitclient_impl.cc +++ b/webkit/glue/webkitclient_impl.cc @@ -28,6 +28,7 @@ #include "webkit/api/public/WebPluginListBuilder.h" #include "webkit/api/public/WebScreenInfo.h" #include "webkit/api/public/WebString.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/glue/chrome_client_impl.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/plugins/plugin_instance.h" @@ -72,7 +73,7 @@ WebWidgetClient* ToWebWidgetClient(WebCore::Widget* widget) { ChromeClientImpl* chrome_client = ToChromeClient(widget); if (!chrome_client || !chrome_client->webview()) return NULL; - return chrome_client->webview()->delegate(); + return chrome_client->webview()->client(); } } diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 22ba10b..7d4bbdc 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -26,13 +26,13 @@ #include "webkit/api/public/WebURLLoader.h" #include "webkit/api/public/WebURLLoaderClient.h" #include "webkit/api/public/WebURLResponse.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/multipart_response_delegate.h" #include "webkit/glue/webplugin_impl.h" #include "webkit/glue/plugins/plugin_host.h" #include "webkit/glue/plugins/plugin_instance.h" #include "webkit/glue/webplugin_delegate.h" #include "webkit/glue/webplugin_page_delegate.h" -#include "webkit/glue/webview.h" #include "googleurl/src/gurl.h" using WebKit::WebCanvas; @@ -58,6 +58,7 @@ using WebKit::WebURLLoaderClient; using WebKit::WebURLRequest; using WebKit::WebURLResponse; using WebKit::WebVector; +using WebKit::WebView; using webkit_glue::MultipartResponseDelegate; namespace webkit_glue { diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index b134db2..df6610b 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -9,12 +9,13 @@ #include "webkit/api/public/WebSettings.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" using WebKit::WebSettings; using WebKit::WebString; using WebKit::WebURL; +using WebKit::WebView; void WebPreferences::Apply(WebView* web_view) const { WebSettings* settings = web_view->settings(); diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index feae9f2..b9d291d 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -14,7 +14,9 @@ #include <string> #include "googleurl/src/gurl.h" +namespace WebKit { class WebView; +} struct WebPreferences { std::wstring standard_font_family; @@ -103,7 +105,7 @@ struct WebPreferences { experimental_notifications_enabled(false) { } - void Apply(WebView* web_view) const; + void Apply(WebKit::WebView* web_view) const; }; #endif // WEBKIT_GLUE_WEBPREFERENCES_H__ diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h deleted file mode 100644 index 765b6f4..0000000 --- a/webkit/glue/webview.h +++ /dev/null @@ -1,56 +0,0 @@ -// 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. - -#ifndef WEBKIT_GLUE_WEBVIEW_H_ -#define WEBKIT_GLUE_WEBVIEW_H_ - -#include "base/basictypes.h" -#include "webkit/api/public/WebView.h" - -class WebViewDelegate; - -// -// @class WebView -// WebView manages the interaction between WebFrameViews and WebDataSources. -// Modification of the policies and behavior of the WebKit is largely managed -// by WebViews and their delegates. -// -// Typical usage: -// -// WebView *webView; -// WebFrame *mainFrame; -// -// webView = [[WebView alloc] initWithFrame: NSMakeRect (0,0,640,480)]; -// mainFrame = [webView mainFrame]; -// [mainFrame loadRequest:request]; -// -// WebViews have a WebViewDelegate that the embedding application implements -// that are required for tasks like opening new windows and controlling the -// user interface elements in those windows, monitoring the progress of loads, -// monitoring URL changes, and making determinations about how content of -// certain types should be handled. -class WebView : public WebKit::WebView { - public: - WebView() {} - virtual ~WebView() {} - - // This method creates a WebView that is NOT yet initialized. You will need - // to call InitializeMainFrame to finish the initialization. You may pass - // NULL for the editing_client parameter if you are not interested in those - // notifications. - static WebView* Create(WebViewDelegate* delegate); - - // Tells all Page instances of this view to update the visited link state for - // the specified hash. - static void UpdateVisitedLinkState(uint64 link_hash); - - // Tells all Page instances of this view to update visited state for all their - // links. - static void ResetVisitedLinkState(); - - private: - DISALLOW_COPY_AND_ASSIGN(WebView); -}; - -#endif // WEBKIT_GLUE_WEBVIEW_H_ diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h deleted file mode 100644 index 5c9e3d7..0000000 --- a/webkit/glue/webview_delegate.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2006-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. - -// WebCore provides hooks for several kinds of functionality, allowing separate -// classes termed "delegates" to receive notifications (in the form of direct -// function calls) when certain events are about to occur or have just occurred. -// In some cases, the delegate implements the needed functionality; in others, -// the delegate has some control over the behavior but doesn't actually -// implement it. For example, the UI delegate is responsible for showing a -// dialog box or otherwise handling a JavaScript window.alert() call, via the -// RunJavaScriptAlert() method. On the other hand, the editor delegate doesn't -// actually handle editing functionality, although it could (for example) -// override whether a content-editable node accepts editing focus by returning -// false from ShouldBeginEditing(). (It would also possible for a more -// special-purpose editing delegate to act on the edited node in some way, e.g. -// to highlight modified text in the DidChangeContents() method.) - -// WebKit divides the delegated tasks into several different classes, but we -// combine them into a single WebViewDelegate. This single delegate encompasses -// the needed functionality of the WebKit UIDelegate, ContextMenuDelegate, -// PolicyDelegate, FrameLoadDelegate, and EditorDelegate; additional portions -// of ChromeClient and FrameLoaderClient not delegated in the WebKit -// implementation; and some WebView additions. - -#ifndef WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ -#define WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ - -#include "webkit/api/public/WebViewClient.h" - -// TODO(darin): Eliminate WebViewDelegate in favor of WebViewClient. -class WebViewDelegate : public WebKit::WebViewClient { - protected: - ~WebViewDelegate() { } -}; - -#endif // WEBKIT_GLUE_WEBVIEW_DELEGATE_H_ diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 5c9b322..e0340bd 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -70,6 +70,7 @@ MSVC_POP_WARNING(); #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebVector.h" +#include "webkit/api/public/WebViewClient.h" #include "webkit/api/src/WebInputEventConversion.h" #include "webkit/api/src/WebSettingsImpl.h" #include "webkit/glue/dom_operations.h" @@ -81,7 +82,6 @@ MSVC_POP_WARNING(); #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpopupmenu_impl.h" #include "webkit/glue/webdevtoolsclient.h" -#include "webkit/glue/webview_delegate.h" #include "webkit/glue/webview_impl.h" // Get rid of WTF's pow define so we can use std::pow. @@ -126,6 +126,7 @@ using WebKit::WebTextDirectionLeftToRight; using WebKit::WebTextDirectionRightToLeft; using WebKit::WebURL; using WebKit::WebVector; +using WebKit::WebViewClient; using webkit_glue::AccessibilityObjectToWebAccessibilityObject; @@ -341,13 +342,29 @@ static const WebCore::PopupContainerSettings kAutocompletePopupSettings = { // WebView ---------------------------------------------------------------- -/*static*/ -WebView* WebView::Create(WebViewDelegate* delegate) { - WebViewImpl* instance = new WebViewImpl(delegate); +namespace WebKit { + +// static +WebView* WebView::create(WebViewClient* client) { + WebViewImpl* instance = new WebViewImpl(client); instance->AddRef(); return instance; } +// static +void WebView::updateVisitedLinkState(unsigned long long link_hash) { + WebCore::Page::visitedStateChanged( + WebCore::PageGroup::pageGroup(pageGroupName), link_hash); +} + +// static +void WebView::resetVisitedLinkState() { + WebCore::Page::allVisitedStateChanged( + WebCore::PageGroup::pageGroup(pageGroupName)); +} + +} // namespace WebKit + void WebViewImpl::initializeMainFrame(WebFrameClient* frame_client) { // NOTE: The WebFrameImpl takes a reference to itself within InitMainFrame // and releases that reference once the corresponding Frame is destroyed. @@ -355,8 +372,8 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frame_client) { main_frame->InitMainFrame(this); - if (client()) { - WebDevToolsAgentClient* tools_client = client()->devToolsAgentClient(); + if (client_) { + WebDevToolsAgentClient* tools_client = client_->devToolsAgentClient(); if (tools_client) devtools_agent_.reset(new WebDevToolsAgentImpl(this, tools_client)); } @@ -367,20 +384,8 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frame_client) { SecurityOrigin::AllowLocalLoadsForLocalOnly); } -// static -void WebView::UpdateVisitedLinkState(uint64 link_hash) { - WebCore::Page::visitedStateChanged( - WebCore::PageGroup::pageGroup(pageGroupName), link_hash); -} - -// static -void WebView::ResetVisitedLinkState() { - WebCore::Page::allVisitedStateChanged( - WebCore::PageGroup::pageGroup(pageGroupName)); -} - -WebViewImpl::WebViewImpl(WebViewDelegate* delegate) - : delegate_(delegate), +WebViewImpl::WebViewImpl(WebViewClient* client) + : client_(client), ALLOW_THIS_IN_INITIALIZER_LIST(back_forward_list_client_impl_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(chrome_client_impl_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(context_menu_client_impl_(this)), @@ -464,7 +469,7 @@ void WebViewImpl::MouseLeave(const WebMouseEvent& event) { if (!main_frame() || !main_frame()->frameview()) return; - client()->setMouseOverURL(WebURL()); + client_->setMouseOverURL(WebURL()); main_frame()->frame()->eventHandler()->handleMouseMoveEvent( PlatformMouseEventBuilder(main_frame()->frameview(), event)); @@ -684,7 +689,7 @@ bool WebViewImpl::AutocompleteHandleKeyEvent(const WebKeyboardEvent& event) { input_element->name()); const WebString& value = webkit_glue::StringToWebString( autocomplete_popup_client_->itemText(selected_index)); - client()->removeAutofillSuggestions(name, value); + client_->removeAutofillSuggestions(name, value); // Update the entries in the currently showing popup to reflect the // deletion. autocomplete_popup_client_->RemoveItemAtIndex(selected_index); @@ -974,9 +979,9 @@ void WebViewImpl::close() { // Reset the delegate to prevent notifications being sent as we're being // deleted. - delegate_ = NULL; + client_ = NULL; - Release(); // Balances AddRef from WebView::Create + Release(); // Balances AddRef from WebView::create } void WebViewImpl::resize(const WebSize& new_size) { @@ -989,9 +994,9 @@ void WebViewImpl::resize(const WebSize& new_size) { main_frame()->frame()->eventHandler()->sendResizeEvent(); } - if (delegate_) { + if (client_) { WebRect damaged_rect(0, 0, size_.width, size_.height); - delegate_->didInvalidateRect(damaged_rect); + client_->didInvalidateRect(damaged_rect); } } @@ -1831,11 +1836,11 @@ bool WebViewImpl::NavigationPolicyFromMouseEvent(unsigned short button, void WebViewImpl::StartDragging(const WebPoint& event_pos, const WebDragData& drag_data, WebDragOperationsMask mask) { - if (!client()) + if (!client_) return; DCHECK(!doing_drag_and_drop_); doing_drag_and_drop_ = true; - client()->startDragging(event_pos, drag_data, mask); + client_->startDragging(event_pos, drag_data, mask); } void WebViewImpl::SetCurrentHistoryItem(WebCore::HistoryItem* item) { @@ -1871,8 +1876,8 @@ void WebViewImpl::SetIgnoreInputEvents(bool new_value) { #if ENABLE(NOTIFICATIONS) WebKit::NotificationPresenterImpl* WebViewImpl::GetNotificationPresenter() { - if (!notification_presenter_.isInitialized() && client()) - notification_presenter_.initialize(client()->notificationPresenter()); + if (!notification_presenter_.isInitialized() && client_) + notification_presenter_.initialize(client_->notificationPresenter()); return ¬ification_presenter_; } #endif diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index 35eaf44..a995e6a 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -17,6 +17,7 @@ #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/NotificationPresenterImpl.h" #include "webkit/glue/back_forward_list_client_impl.h" #include "webkit/glue/chrome_client_impl.h" @@ -26,7 +27,6 @@ #include "webkit/glue/inspector_client_impl.h" #include "webkit/glue/webframe_impl.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" namespace WebCore { class ChromiumDataObject; @@ -58,9 +58,9 @@ class AutocompletePopupMenuClient; class SearchableFormData; class WebHistoryItemImpl; class WebDevToolsAgentImpl; -class WebViewDelegate; -class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { +class WebViewImpl : public WebKit::WebView, + public base::RefCounted<WebViewImpl> { public: // WebWidget methods: virtual void close(); @@ -144,12 +144,11 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { int defaultSuggestionIndex); virtual void hideAutofillPopup(); - // WebView methods: - virtual void SetIgnoreInputEvents(bool new_value); - WebDevToolsAgentImpl* GetWebDevToolsAgentImpl(); - // WebViewImpl + void SetIgnoreInputEvents(bool new_value); + WebDevToolsAgentImpl* GetWebDevToolsAgentImpl(); + const WebKit::WebPoint& last_mouse_down_point() const { return last_mouse_down_point_; } @@ -162,12 +161,7 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { static WebViewImpl* FromPage(WebCore::Page* page); WebKit::WebViewClient* client() { - return delegate_; - } - - // TODO(darin): Remove this method in favor of client(). - WebViewDelegate* delegate() { - return delegate_; + return client_; } // Returns the page object associated with this view. This may be NULL when @@ -257,17 +251,17 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { WebCore::ScrollGranularity scroll_granularity); protected: - friend class WebView; // So WebView::Create can call our constructor + friend class WebKit::WebView; // So WebView::Create can call our constructor friend class base::RefCounted<WebViewImpl>; - WebViewImpl(WebViewDelegate* delegate); + WebViewImpl(WebKit::WebViewClient* client); ~WebViewImpl(); void ModifySelection(uint32 message, WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent& e); - WebViewDelegate* delegate_; + WebKit::WebViewClient* client_; webkit_glue::BackForwardListClientImpl back_forward_list_client_impl_; ChromeClientImpl chrome_client_impl_; @@ -282,7 +276,7 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { scoped_ptr<WebCore::Page> page_; // This flag is set when a new navigation is detected. It is used to satisfy - // the corresponding argument to WebViewDelegate::DidCommitLoadForFrame. + // 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 diff --git a/webkit/glue/webview_unittest.cc b/webkit/glue/webview_unittest.cc index 36f87c8..4c524f8 100644 --- a/webkit/glue/webview_unittest.cc +++ b/webkit/glue/webview_unittest.cc @@ -3,9 +3,11 @@ // found in the LICENSE file. #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/glue/webview.h" +#include "webkit/api/public/WebView.h" #include "webkit/tools/test_shell/test_shell_test.h" +using WebKit::WebView; + class WebViewTest : public TestShellTest { }; diff --git a/webkit/glue/webworker_impl.cc b/webkit/glue/webworker_impl.cc index 18f3870..5eda75a 100644 --- a/webkit/glue/webworker_impl.cc +++ b/webkit/glue/webworker_impl.cc @@ -28,6 +28,7 @@ #include "webkit/api/public/WebScreenInfo.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" +#include "webkit/api/public/WebView.h" #include "webkit/api/public/WebWorkerClient.h" #include "webkit/api/src/PlatformMessagePortChannel.h" #include "webkit/api/src/WebDataSourceImpl.h" @@ -35,8 +36,6 @@ #include "webkit/glue/glue_util.h" #include "webkit/glue/webframe_impl.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" -#include "webkit/glue/webview_delegate.h" #include "webkit/glue/webworker_impl.h" using WebKit::WebCursorInfo; @@ -53,6 +52,7 @@ using WebKit::WebString; using WebKit::WebURL; using WebKit::WebWorker; using WebKit::WebWorkerClient; +using WebKit::WebView; #if ENABLE(WORKERS) @@ -143,7 +143,7 @@ void WebWorkerImpl::startWorkerContext(const WebURL& script_url, // loading requests from the worker context to the rest of WebKit and Chromium // infrastructure. DCHECK(!web_view_); - web_view_ = WebView::Create(NULL); + web_view_ = WebView::create(NULL); WebPreferences().Apply(web_view_); web_view_->initializeMainFrame(WorkerWebFrameClient::GetSharedInstance()); diff --git a/webkit/glue/webworker_impl.h b/webkit/glue/webworker_impl.h index 33c7b05..53c745a 100644 --- a/webkit/glue/webworker_impl.h +++ b/webkit/glue/webworker_impl.h @@ -17,9 +17,11 @@ namespace WebCore { class WorkerThread; -}; +} +namespace WebKit { class WebView; +} // This class is used by the worker process code to talk to the WebCore::Worker // implementation. It can't use it directly since it uses WebKit types, so this @@ -127,7 +129,7 @@ class WebWorkerImpl: public WebCore::WorkerObjectProxy, // 'shadow page' - created to proxy loading requests from the worker. WTF::RefPtr<WebCore::ScriptExecutionContext> loading_document_; - WebView* web_view_; + WebKit::WebView* web_view_; bool asked_to_terminate_; WTF::RefPtr<WebCore::WorkerThread> worker_thread_; diff --git a/webkit/tools/test_shell/drag_delegate.cc b/webkit/tools/test_shell/drag_delegate.cc index 0fc97a3..f0247ca 100644 --- a/webkit/tools/test_shell/drag_delegate.cc +++ b/webkit/tools/test_shell/drag_delegate.cc @@ -5,9 +5,10 @@ #include "webkit/tools/test_shell/drag_delegate.h" #include "webkit/api/public/WebPoint.h" -#include "webkit/glue/webview.h" +#include "webkit/api/public/WebView.h" using WebKit::WebPoint; +using WebKit::WebView; namespace { diff --git a/webkit/tools/test_shell/drag_delegate.h b/webkit/tools/test_shell/drag_delegate.h index 0b33487..1fde8e4 100644 --- a/webkit/tools/test_shell/drag_delegate.h +++ b/webkit/tools/test_shell/drag_delegate.h @@ -9,11 +9,13 @@ #include "base/base_drag_source.h" +namespace WebKit { class WebView; +} class TestDragDelegate : public BaseDragSource { public: - TestDragDelegate(HWND source_hwnd, WebView* webview) + TestDragDelegate(HWND source_hwnd, WebKit::WebView* webview) : BaseDragSource(), source_hwnd_(source_hwnd), webview_(webview) { } @@ -25,7 +27,7 @@ class TestDragDelegate : public BaseDragSource { virtual void OnDragSourceMove(); private: - WebView* webview_; + WebKit::WebView* webview_; // A HWND for the source we are associated with, used for translating // mouse coordinates from screen to client coordinates. diff --git a/webkit/tools/test_shell/drop_delegate.cc b/webkit/tools/test_shell/drop_delegate.cc index d7d3934..0ef7ae6 100644 --- a/webkit/tools/test_shell/drop_delegate.cc +++ b/webkit/tools/test_shell/drop_delegate.cc @@ -6,12 +6,13 @@ #include "webkit/api/public/WebDragData.h" #include "webkit/api/public/WebPoint.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webdropdata.h" -#include "webkit/glue/webview.h" using WebKit::WebDragOperation; using WebKit::WebDragOperationCopy; using WebKit::WebPoint; +using WebKit::WebView; // BaseDropTarget methods ---------------------------------------------------- diff --git a/webkit/tools/test_shell/drop_delegate.h b/webkit/tools/test_shell/drop_delegate.h index 7064607..8a1442a 100644 --- a/webkit/tools/test_shell/drop_delegate.h +++ b/webkit/tools/test_shell/drop_delegate.h @@ -9,11 +9,13 @@ #include "base/base_drop_target.h" +namespace WebKit { class WebView; +} class TestDropDelegate : public BaseDropTarget { public: - TestDropDelegate(HWND source_hwnd, WebView* webview) + TestDropDelegate(HWND source_hwnd, WebKit::WebView* webview) : BaseDropTarget(source_hwnd), webview_(webview) { } @@ -35,7 +37,7 @@ class TestDropDelegate : public BaseDropTarget { private: - WebView* webview_; + WebKit::WebView* webview_; }; #endif // WEBKIT_TOOLS_TEST_SHELL_DROP_DELEGATE_H__ diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc index 87034ca..3a024d8 100644 --- a/webkit/tools/test_shell/event_sending_controller.cc +++ b/webkit/tools/test_shell/event_sending_controller.cc @@ -36,8 +36,8 @@ #include "webkit/api/public/WebDragOperation.h" #include "webkit/api/public/WebPoint.h" #include "webkit/api/public/WebString.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_shell.h" #if defined(OS_WIN) @@ -58,6 +58,7 @@ using WebKit::WebKeyboardEvent; using WebKit::WebMouseEvent; using WebKit::WebPoint; using WebKit::WebString; +using WebKit::WebView; TestShell* EventSendingController::shell_ = NULL; gfx::Point EventSendingController::last_mouse_pos_; diff --git a/webkit/tools/test_shell/event_sending_controller.h b/webkit/tools/test_shell/event_sending_controller.h index ba2a3b2..3593ff6a 100644 --- a/webkit/tools/test_shell/event_sending_controller.h +++ b/webkit/tools/test_shell/event_sending_controller.h @@ -24,10 +24,10 @@ #include "webkit/glue/cpp_bound_class.h" class TestShell; -class WebView; namespace WebKit { class WebDragData; +class WebView; struct WebPoint; } @@ -81,7 +81,7 @@ class EventSendingController : public CppBoundClass { private: // Returns the test shell's webview. - static WebView* webview(); + static WebKit::WebView* webview(); // Returns true if dragMode is true. bool drag_mode() { return dragMode.isBool() && dragMode.ToBoolean(); } diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index d757d8b..cac9065 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -19,9 +19,9 @@ #include "webkit/api/public/WebKit.h" #include "webkit/api/public/WebScriptSource.h" #include "webkit/api/public/WebURL.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/simple_database_system.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_navigation_controller.h" diff --git a/webkit/tools/test_shell/mac/test_shell_webview.mm b/webkit/tools/test_shell/mac/test_shell_webview.mm index 251e8b6..ed9b84e 100644 --- a/webkit/tools/test_shell/mac/test_shell_webview.mm +++ b/webkit/tools/test_shell/mac/test_shell_webview.mm @@ -10,7 +10,7 @@ #include "base/scoped_ptr.h" #include "base/string_util.h" #include "webkit/api/public/WebFrame.h" -#include "webkit/glue/webview.h" +#include "webkit/api/public/WebView.h" #include "webkit/tools/test_shell/test_shell.h" #include "webkit/tools/test_shell/webwidget_host.h" diff --git a/webkit/tools/test_shell/mac/test_webview_delegate.mm b/webkit/tools/test_shell/mac/test_webview_delegate.mm index 3d298b9..186c3fd 100644 --- a/webkit/tools/test_shell/mac/test_webview_delegate.mm +++ b/webkit/tools/test_shell/mac/test_webview_delegate.mm @@ -9,8 +9,8 @@ #include "base/sys_string_conversions.h" #include "webkit/api/public/WebCursorInfo.h" #include "webkit/api/public/WebPopupMenu.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webcursor.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/webmenurunner_mac.h" diff --git a/webkit/tools/test_shell/mac/webview_host.mm b/webkit/tools/test_shell/mac/webview_host.mm index 9f267a9..3e13f76 100644 --- a/webkit/tools/test_shell/mac/webview_host.mm +++ b/webkit/tools/test_shell/mac/webview_host.mm @@ -11,11 +11,12 @@ #include "base/gfx/size.h" #include "skia/ext/platform_canvas.h" #include "webkit/api/public/WebSize.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_webview_delegate.h" using WebKit::WebSize; +using WebKit::WebView; // static WebViewHost* WebViewHost::Create(NSView* parent_view, @@ -35,7 +36,7 @@ WebViewHost* WebViewHost::Create(NSView* parent_view, [parent_view addSubview:host->view_]; [host->view_ release]; - host->webwidget_ = WebView::Create(delegate); + host->webwidget_ = WebView::create(delegate); prefs.Apply(host->webview()); host->webview()->initializeMainFrame(delegate); host->webwidget_->resize(WebSize(content_rect.size.width, diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc index 7f7214e..7b374fd 100644 --- a/webkit/tools/test_shell/plugin_tests.cc +++ b/webkit/tools/test_shell/plugin_tests.cc @@ -14,7 +14,7 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebInputEvent.h" #include "webkit/api/public/WebScriptSource.h" -#include "webkit/glue/webview.h" +#include "webkit/api/public/WebView.h" #include "webkit/tools/test_shell/test_shell.h" #include "webkit/tools/test_shell/test_shell_test.h" diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index e6dad8a..97c2eba 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -41,10 +41,10 @@ #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebURLRequest.h" #include "webkit/api/public/WebURLResponse.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/accessibility_controller.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_navigation_controller.h" @@ -56,6 +56,7 @@ using WebKit::WebNavigationPolicy; using WebKit::WebRect; using WebKit::WebSize; using WebKit::WebURLRequest; +using WebKit::WebView; namespace { diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index d50aa80..9ff142b 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -94,7 +94,7 @@ public: // cleanup. void PlatformCleanUp(); - WebView* webView() { + WebKit::WebView* webView() { return m_webViewHost.get() ? m_webViewHost->webview() : NULL; } WebViewHost* webViewHost() { return m_webViewHost.get(); } @@ -186,7 +186,7 @@ public: // Implements CreateWebView for TestWebViewDelegate, which in turn // is called as a WebViewDelegate. - WebView* CreateWebView(); + WebKit::WebView* CreateWebView(); WebKit::WebWidget* CreatePopupWidget(); void ClosePopup(); diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 9b50e24..433f191 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -25,11 +25,11 @@ #include "net/base/net_util.h" #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebPoint.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_navigation_controller.h" #include "webkit/tools/test_shell/test_webview_delegate.h" diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index d67eb38..9acf823 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -29,9 +29,9 @@ #include "skia/ext/bitmap_platform_device.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/api/public/WebFrame.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/tools/test_shell/mac/test_shell_webview.h" #include "webkit/tools/test_shell/resource.h" diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index f2e518a..80344b7 100644 --- a/webkit/tools/test_shell/test_shell_win.cc +++ b/webkit/tools/test_shell/test_shell_win.cc @@ -28,9 +28,9 @@ #include "net/url_request/url_request_file_job.h" #include "skia/ext/bitmap_platform_device.h" #include "webkit/api/public/WebFrame.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/tools/test_shell/resource.h" #include "webkit/tools/test_shell/test_navigation_controller.h" diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 43922d6..b90ce12 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -40,6 +40,7 @@ #include "webkit/api/public/WebURLError.h" #include "webkit/api/public/WebURLRequest.h" #include "webkit/api/public/WebURLResponse.h" +#include "webkit/api/public/WebView.h" #include "webkit/appcache/appcache_interfaces.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/glue_util.h" @@ -50,7 +51,6 @@ #include "webkit/glue/webplugin_impl.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/webmediaplayer_impl.h" @@ -101,6 +101,7 @@ using WebKit::WebURLResponse; using WebKit::WebWidget; using WebKit::WebWorker; using WebKit::WebWorkerClient; +using WebKit::WebView; using webkit_glue::AccessibilityObjectToWebAccessibilityObject; diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 155bb64..f5a5632 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -30,9 +30,9 @@ #if defined(OS_MACOSX) #include "webkit/api/public/WebPopupMenuInfo.h" #endif +#include "webkit/api/public/WebViewClient.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webplugin_page_delegate.h" -#include "webkit/glue/webview_delegate.h" #if defined(OS_WIN) #include "webkit/tools/test_shell/drag_delegate.h" #include "webkit/tools/test_shell/drop_delegate.h" @@ -44,7 +44,7 @@ class GURL; class TestShell; class WebWidgetHost; -class TestWebViewDelegate : public WebViewDelegate, +class TestWebViewDelegate : public WebKit::WebViewClient, public WebKit::WebFrameClient, public webkit_glue::WebPluginPageDelegate, public base::SupportsWeakPtr<TestWebViewDelegate> { @@ -66,7 +66,7 @@ class TestWebViewDelegate : public WebViewDelegate, typedef std::vector<CapturedContextMenuEvent> CapturedContextMenuEvents; // WebKit::WebViewClient - virtual WebView* createView(WebKit::WebFrame* creator); + virtual WebKit::WebView* createView(WebKit::WebFrame* creator); virtual WebKit::WebWidget* createPopupMenu(bool activatable); virtual WebKit::WebWidget* createPopupMenu( const WebKit::WebPopupMenuInfo& info); @@ -316,7 +316,7 @@ class TestWebViewDelegate : public WebViewDelegate, // Called when the URL of the page changes. // Extracts the URL and forwards on to SetAddressBarURL(). - void UpdateAddressBar(WebView* webView); + void UpdateAddressBar(WebKit::WebView* webView); // Called when the URL of the page changes. // Should be used to update the text of the URL bar. diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index 728c5ad..288ca24 100644 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -20,12 +20,12 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebString.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webplugin.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/gtk_plugin_container_manager.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/window_open_disposition.h" @@ -39,6 +39,7 @@ using WebKit::WebNavigationPolicy; using WebKit::WebPopupMenuInfo; using WebKit::WebRect; using WebKit::WebWidget; +using WebKit::WebView; namespace { diff --git a/webkit/tools/test_shell/test_webview_delegate_win.cc b/webkit/tools/test_shell/test_webview_delegate_win.cc index 8d0f291..180e5f9 100644 --- a/webkit/tools/test_shell/test_webview_delegate_win.cc +++ b/webkit/tools/test_shell/test_webview_delegate_win.cc @@ -22,11 +22,11 @@ #include "webkit/api/public/WebCursorInfo.h" #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebRect.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webplugin.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webview.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/window_open_disposition.h" diff --git a/webkit/tools/test_shell/text_input_controller.cc b/webkit/tools/test_shell/text_input_controller.cc index 529fb61..0bc873e 100644 --- a/webkit/tools/test_shell/text_input_controller.cc +++ b/webkit/tools/test_shell/text_input_controller.cc @@ -8,7 +8,7 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebRange.h" #include "webkit/api/public/WebString.h" -#include "webkit/glue/webview.h" +#include "webkit/api/public/WebView.h" #include "webkit/tools/test_shell/test_shell.h" using WebKit::WebFrame; diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index ebc7ab9..9ac1fc6 100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -16,9 +16,12 @@ #endif struct WebPreferences; -class WebView; class TestWebViewDelegate; +namespace WebKit { +class WebView; +} + // This class is a simple NativeView-based host for a WebView class WebViewHost : public WebWidgetHost { public: @@ -29,7 +32,7 @@ class WebViewHost : public WebWidgetHost { TestWebViewDelegate* delegate, const WebPreferences& prefs); - WebView* webview() const; + WebKit::WebView* webview() const; #if defined(OS_LINUX) // Create a new plugin parent container for a given plugin XID. diff --git a/webkit/tools/test_shell/webview_host_gtk.cc b/webkit/tools/test_shell/webview_host_gtk.cc index 88f5a91..dd2e593 100644 --- a/webkit/tools/test_shell/webview_host_gtk.cc +++ b/webkit/tools/test_shell/webview_host_gtk.cc @@ -10,11 +10,13 @@ #include "base/gfx/rect.h" #include "base/gfx/size.h" #include "skia/ext/platform_canvas.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/plugins/gtk_plugin_container.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_webview_delegate.h" +using WebKit::WebView; + // static WebViewHost* WebViewHost::Create(GtkWidget* parent_view, TestWebViewDelegate* delegate, @@ -24,7 +26,7 @@ WebViewHost* WebViewHost::Create(GtkWidget* parent_view, host->view_ = WebWidgetHost::CreateWidget(parent_view, host); host->plugin_container_manager_.set_host_widget(host->view_); - host->webwidget_ = WebView::Create(delegate); + host->webwidget_ = WebView::create(delegate); prefs.Apply(host->webview()); host->webview()->initializeMainFrame(delegate); host->webwidget_->layout(); diff --git a/webkit/tools/test_shell/webview_host_win.cc b/webkit/tools/test_shell/webview_host_win.cc index 81ee86e..abbe53f 100644 --- a/webkit/tools/test_shell/webview_host_win.cc +++ b/webkit/tools/test_shell/webview_host_win.cc @@ -8,10 +8,12 @@ #include "base/gfx/size.h" #include "base/win_util.h" #include "skia/ext/platform_canvas.h" +#include "webkit/api/public/WebView.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_webview_delegate.h" +using namespace WebKit; + static const wchar_t kWindowClassName[] = L"WebViewHost"; /*static*/ @@ -39,7 +41,7 @@ WebViewHost* WebViewHost::Create(HWND parent_view, GetModuleHandle(NULL), NULL); win_util::SetWindowUserData(host->view_, host); - host->webwidget_ = WebView::Create(delegate); + host->webwidget_ = WebView::create(delegate); prefs.Apply(host->webview()); host->webview()->initializeMainFrame(delegate); diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 5877e74..a0c3fba 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -646,8 +646,6 @@ 'glue/webthemeengine_impl_win.cc', 'glue/weburlloader_impl.cc', 'glue/weburlloader_impl.h', - 'glue/webview.h', - 'glue/webview_delegate.h', 'glue/webview_impl.cc', 'glue/webview_impl.h', 'glue/webworker_impl.cc', |