Merge WebDocumentLoaderImpl into WebDataSourceImpl. They are peers, and it is
really silly to have them be separate classes.
I chose to eliminate WebDocumentLoaderImpl in favor of WebDataSourceImpl since
the interface that the outside world sees is named WebDataSource.
R=dglazkov
Review URL: http://codereview.chromium.org/46028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11637 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc
index 64222c2..65089c9 100644
--- a/webkit/glue/context_menu_client_impl.cc
+++ b/webkit/glue/context_menu_client_impl.cc
@@ -25,7 +25,7 @@
#include "base/string_util.h"
#include "webkit/glue/context_menu.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/webdocumentloader_impl.h"
+#include "webkit/glue/webdatasource_impl.h"
#include "webkit/glue/webresponse.h"
#include "webkit/glue/weburlrequest_impl.h"
#include "webkit/glue/webview_impl.h"
@@ -124,8 +124,7 @@
if (frame) {
WebCore::DocumentLoader* dl = frame->loader()->documentLoader();
if (dl) {
- WebDataSource* ds = static_cast<WebDocumentLoaderImpl*>(dl)->
- GetDataSource();
+ WebDataSource* ds = WebDataSourceImpl::FromLoader(dl);
if (ds) {
node = page_node;
*url = ds->HasUnreachableURL() ? ds->GetUnreachableURL()
@@ -214,13 +213,10 @@
// Now retrieve the security info.
WebCore::DocumentLoader* dl = selected_frame->loader()->documentLoader();
- if (dl) {
- WebDataSource* ds = static_cast<WebDocumentLoaderImpl*>(dl)->
- GetDataSource();
- if (ds) {
- const WebResponse& response = ds->GetResponse();
- security_info = response.GetSecurityInfo();
- }
+ WebDataSource* ds = WebDataSourceImpl::FromLoader(dl);
+ if (ds) {
+ const WebResponse& response = ds->GetResponse();
+ security_info = response.GetSecurityInfo();
}
int edit_flags = ContextNode::CAN_DO_NONE;