| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/tools/test_shell/webview_host.h" | 5 #include "webkit/tools/test_shell/webview_host.h" |
| 6 | 6 |
| 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 8 #include "ui/base/win/hwnd_util.h" | 8 #include "ui/base/win/hwnd_util.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 11 #include "webkit/glue/webpreferences.h" | 11 #include "webkit/glue/webpreferences.h" |
| 12 #include "webkit/tools/test_shell/test_webview_delegate.h" | 12 #include "webkit/tools/test_shell/test_webview_delegate.h" |
| 13 | 13 |
| 14 using namespace WebKit; | 14 using namespace WebKit; |
| 15 | 15 |
| 16 static const wchar_t kWindowClassName[] = L"WebViewHost"; | 16 static const wchar_t kWindowClassName[] = L"WebViewHost"; |
| 17 | 17 |
| 18 /*static*/ | 18 /*static*/ |
| 19 WebViewHost* WebViewHost::Create(HWND parent_view, | 19 WebViewHost* WebViewHost::Create(HWND parent_view, |
| 20 TestWebViewDelegate* delegate, | 20 TestWebViewDelegate* delegate, |
| 21 WebDevToolsAgentClient* dev_tools_client, | 21 WebDevToolsAgentClient* dev_tools_client, |
| 22 const WebPreferences& prefs) { | 22 const webkit_glue::WebPreferences& prefs) { |
| 23 WebViewHost* host = new WebViewHost(); | 23 WebViewHost* host = new WebViewHost(); |
| 24 | 24 |
| 25 static bool registered_class = false; | 25 static bool registered_class = false; |
| 26 if (!registered_class) { | 26 if (!registered_class) { |
| 27 WNDCLASSEX wcex = {0}; | 27 WNDCLASSEX wcex = {0}; |
| 28 wcex.cbSize = sizeof(wcex); | 28 wcex.cbSize = sizeof(wcex); |
| 29 wcex.style = CS_DBLCLKS; | 29 wcex.style = CS_DBLCLKS; |
| 30 wcex.lpfnWndProc = WebWidgetHost::WndProc; | 30 wcex.lpfnWndProc = WebWidgetHost::WndProc; |
| 31 wcex.hInstance = GetModuleHandle(NULL); | 31 wcex.hInstance = GetModuleHandle(NULL); |
| 32 wcex.hCursor = LoadCursor(NULL, IDC_ARROW); | 32 wcex.hCursor = LoadCursor(NULL, IDC_ARROW); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 45 host->webview()->setDevToolsAgentClient(dev_tools_client); | 45 host->webview()->setDevToolsAgentClient(dev_tools_client); |
| 46 prefs.Apply(host->webview()); | 46 prefs.Apply(host->webview()); |
| 47 host->webview()->initializeMainFrame(delegate); | 47 host->webview()->initializeMainFrame(delegate); |
| 48 | 48 |
| 49 return host; | 49 return host; |
| 50 } | 50 } |
| 51 | 51 |
| 52 WebView* WebViewHost::webview() const { | 52 WebView* WebViewHost::webview() const { |
| 53 return static_cast<WebView*>(webwidget_); | 53 return static_cast<WebView*>(webwidget_); |
| 54 } | 54 } |
| OLD | NEW |