diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 16:30:07 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 16:30:07 +0000 |
commit | a2c04149d7404cb361e588417e38c82008298e92 (patch) | |
tree | 4ec05299f22544e6948f0f407b96b2512aa7f31f | |
parent | d5a276e97343c5a85c48bbbc9d1218ef943f6707 (diff) | |
download | chromium_src-a2c04149d7404cb361e588417e38c82008298e92.zip chromium_src-a2c04149d7404cb361e588417e38c82008298e92.tar.gz chromium_src-a2c04149d7404cb361e588417e38c82008298e92.tar.bz2 |
Revert 50726 "DevTools: Migrate to new WebView initialization (pass devtools client directly)."
Review URL: http://codereview.chromium.org/2871023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50727 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | chrome/renderer/print_web_view_helper.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 5 | ||||
-rw-r--r--[-rwxr-xr-x] | webkit/tools/test_shell/test_shell.h | 7 | ||||
-rw-r--r--[-rwxr-xr-x] | webkit/tools/test_shell/test_shell_devtools_agent.cc | 11 | ||||
-rw-r--r--[-rwxr-xr-x] | webkit/tools/test_shell/test_shell_devtools_agent.h | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | webkit/tools/test_shell/test_shell_win.cc | 11 | ||||
-rw-r--r--[-rwxr-xr-x] | webkit/tools/test_shell/webview_host.h | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | webkit/tools/test_shell/webview_host_win.cc | 3 |
10 files changed, 24 insertions, 27 deletions
@@ -1,7 +1,7 @@ vars = { "webkit_trunk": "http://svn.webkit.org/repository/webkit/trunk", - "webkit_revision": "61766", + "webkit_revision": "61756", "ffmpeg_revision": "49485", "skia_revision": "582", "chromium_git": "http://src.chromium.org/git", diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index 726ce2d..9bab6a3 100755..100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -246,7 +246,7 @@ bool PrintWebViewHelper::CopyAndPrint(const ViewMsg_PrintPages_Params& params, prefs.javascript_enabled = false; prefs.java_enabled = false; - print_web_view_ = WebView::create(this, 0); + print_web_view_ = WebView::create(this); prefs.Apply(print_web_view_); print_web_view_->initializeMainFrame(this); diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 312161b..6b95e29 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -561,12 +561,14 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd, devtools_agent_.reset(new DevToolsAgent(routing_id, this)); - webwidget_ = WebView::create(this, devtools_agent_.get()); + webwidget_ = WebView::create(this); Singleton<ViewMap>::get()->insert(std::make_pair(webview(), this)); webkit_preferences_.Apply(webview()); webview()->initializeMainFrame(this); if (!frame_name.empty()) webview()->mainFrame()->setName(frame_name); + webview()->setDevToolsAgent( + WebDevToolsAgent::create(webview(), devtools_agent_.get())); OnSetRendererPrefs(renderer_prefs); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 62bacb2..90c8abc 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -583,6 +583,11 @@ WebView* TestShell::CreateWebView() { return new_win->webView(); } +void TestShell::InitializeDevToolsAgent(WebView* webView) { + DCHECK(!dev_tools_agent_.get()); + dev_tools_agent_.reset(new TestShellDevToolsAgent(webView)); +} + void TestShell::ShowDevTools() { if (!devtools_shell_) { FilePath dir_exe; diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index f415d54..21d8856 100755..100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -92,7 +92,7 @@ public: static void CleanupLogging(); // Initialization and clean up of a static member variable. - static void InitializeTestShell(bool layout_test_mode, + static void InitializeTestShell(bool layout_test_mode, bool allow_external_pages); static void ShutdownTestShell(); @@ -329,6 +329,7 @@ public: protected: void CreateDevToolsClient(TestShellDevToolsAgent* agent); bool Initialize(const GURL& starting_url); + void InitializeDevToolsAgent(WebKit::WebView* webView); bool IsSVGTestURL(const GURL& url); void SizeToSVG(); void SizeToDefault(); @@ -385,9 +386,9 @@ private: // True when the app is being run using the --layout-tests switch. static bool layout_test_mode_; - + // True when we wish to allow test shell to load external pages like - // www.google.com even when in --layout-test mode (used for QA to + // www.google.com even when in --layout-test mode (used for QA to // produce images of the rendered page) static bool allow_external_pages_; diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.cc b/webkit/tools/test_shell/test_shell_devtools_agent.cc index 20e8c16..704827d 100755..100644 --- a/webkit/tools/test_shell/test_shell_devtools_agent.cc +++ b/webkit/tools/test_shell/test_shell_devtools_agent.cc @@ -57,18 +57,17 @@ void TestShellDevToolsAgent::DispatchMessageLoop() { #pragma warning(disable : 4355) #endif // defined(OS_WIN) -TestShellDevToolsAgent::TestShellDevToolsAgent() +TestShellDevToolsAgent::TestShellDevToolsAgent(WebView* web_view) : call_method_factory_(this), - dev_tools_client_(NULL) { + dev_tools_client_(NULL), + web_view_(web_view) { static int dev_tools_agent_counter; routing_id_ = ++dev_tools_agent_counter; if (routing_id_ == 1) WebDevToolsAgent::setMessageLoopDispatchHandler( &TestShellDevToolsAgent::DispatchMessageLoop); -} - -void TestShellDevToolsAgent::SetWebView(WebKit::WebView* web_view) { - web_view_ = web_view; + web_dev_tools_agent_ = WebDevToolsAgent::create(web_view_, this); + web_view_->setDevToolsAgent(web_dev_tools_agent_); } void TestShellDevToolsAgent::sendMessageToFrontend( diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.h b/webkit/tools/test_shell/test_shell_devtools_agent.h index baf7174..8020876 100755..100644 --- a/webkit/tools/test_shell/test_shell_devtools_agent.h +++ b/webkit/tools/test_shell/test_shell_devtools_agent.h @@ -23,11 +23,9 @@ class TestShellDevToolsClient; class TestShellDevToolsAgent : public WebKit::WebDevToolsAgentClient { public: - TestShellDevToolsAgent(); + TestShellDevToolsAgent(WebKit::WebView* web_view); virtual ~TestShellDevToolsAgent() {} - void SetWebView(WebKit::WebView* web_view); - // WebDevToolsAgentClient implementation. virtual void sendMessageToFrontend( const WebKit::WebDevToolsMessageData& data); diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index 079a830..841d724 100755..100644 --- a/webkit/tools/test_shell/test_shell_win.cc +++ b/webkit/tools/test_shell/test_shell_win.cc @@ -34,7 +34,6 @@ #include "webkit/glue/plugins/plugin_list.h" #include "webkit/tools/test_shell/resource.h" #include "webkit/tools/test_shell/test_navigation_controller.h" -#include "webkit/tools/test_shell/test_shell_devtools_agent.h" #include "webkit/tools/test_shell/test_shell_switches.h" #include "webkit/tools/test_shell/test_webview_delegate.h" @@ -393,17 +392,13 @@ bool TestShell::Initialize(const GURL& starting_url) { win_util::SetWindowProc(m_editWnd, TestShell::EditWndProc); win_util::SetWindowUserData(m_editWnd, this); - dev_tools_agent_.reset(new TestShellDevToolsAgent()); - // create webview m_webViewHost.reset( - WebViewHost::Create(m_mainWnd, - delegate_.get(), - dev_tools_agent_.get(), - *TestShell::web_prefs_)); - dev_tools_agent_->SetWebView(m_webViewHost->webview()); + WebViewHost::Create(m_mainWnd, delegate_.get(), *TestShell::web_prefs_)); delegate_->RegisterDragDrop(); + InitializeDevToolsAgent(webView()); + // Load our initial content. if (starting_url.is_valid()) LoadURL(starting_url); diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index 2fc545f..2f09dec 100755..100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -20,7 +20,6 @@ struct WebPreferences; class TestWebViewDelegate; namespace WebKit { -class WebDevToolsAgentClient; class WebView; } @@ -32,7 +31,6 @@ class WebViewHost : public WebWidgetHost { // MoveWindow (or equivalent) function. static WebViewHost* Create(gfx::NativeView parent_view, TestWebViewDelegate* delegate, - WebKit::WebDevToolsAgentClient* devtoolsClient, const WebPreferences& prefs); WebKit::WebView* webview() const; diff --git a/webkit/tools/test_shell/webview_host_win.cc b/webkit/tools/test_shell/webview_host_win.cc index 17c8fa1..3c2e9a8 100755..100644 --- a/webkit/tools/test_shell/webview_host_win.cc +++ b/webkit/tools/test_shell/webview_host_win.cc @@ -19,7 +19,6 @@ static const wchar_t kWindowClassName[] = L"WebViewHost"; /*static*/ WebViewHost* WebViewHost::Create(HWND parent_view, TestWebViewDelegate* delegate, - WebDevToolsAgentClient* devToolsClient, const WebPreferences& prefs) { WebViewHost* host = new WebViewHost(); @@ -42,7 +41,7 @@ WebViewHost* WebViewHost::Create(HWND parent_view, GetModuleHandle(NULL), NULL); win_util::SetWindowUserData(host->view_, host); - host->webwidget_ = WebView::create(delegate, devToolsClient); + host->webwidget_ = WebView::create(delegate); prefs.Apply(host->webview()); host->webview()->initializeMainFrame(delegate); |