| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/win/hwnd_util.h" | |
| 8 #include "gfx/rect.h" | 7 #include "gfx/rect.h" |
| 9 #include "gfx/size.h" | 8 #include "gfx/size.h" |
| 10 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 11 #include "ui/base/win/hwnd_util.h" |
| 12 #include "webkit/glue/webpreferences.h" | 12 #include "webkit/glue/webpreferences.h" |
| 13 #include "webkit/tools/test_shell/test_webview_delegate.h" | 13 #include "webkit/tools/test_shell/test_webview_delegate.h" |
| 14 | 14 |
| 15 using namespace WebKit; | 15 using namespace WebKit; |
| 16 | 16 |
| 17 static const wchar_t kWindowClassName[] = L"WebViewHost"; | 17 static const wchar_t kWindowClassName[] = L"WebViewHost"; |
| 18 | 18 |
| 19 /*static*/ | 19 /*static*/ |
| 20 WebViewHost* WebViewHost::Create(HWND parent_view, | 20 WebViewHost* WebViewHost::Create(HWND parent_view, |
| 21 TestWebViewDelegate* delegate, | 21 TestWebViewDelegate* delegate, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 33 wcex.hCursor = LoadCursor(NULL, IDC_ARROW); | 33 wcex.hCursor = LoadCursor(NULL, IDC_ARROW); |
| 34 wcex.lpszClassName = kWindowClassName; | 34 wcex.lpszClassName = kWindowClassName; |
| 35 RegisterClassEx(&wcex); | 35 RegisterClassEx(&wcex); |
| 36 registered_class = true; | 36 registered_class = true; |
| 37 } | 37 } |
| 38 | 38 |
| 39 host->view_ = CreateWindow(kWindowClassName, NULL, | 39 host->view_ = CreateWindow(kWindowClassName, NULL, |
| 40 WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, 0, 0, | 40 WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, 0, 0, |
| 41 0, 0, parent_view, NULL, | 41 0, 0, parent_view, NULL, |
| 42 GetModuleHandle(NULL), NULL); | 42 GetModuleHandle(NULL), NULL); |
| 43 app::win::SetWindowUserData(host->view_, host); | 43 ui::SetWindowUserData(host->view_, host); |
| 44 | 44 |
| 45 host->webwidget_ = WebView::create(delegate, dev_tools_client, NULL); | 45 host->webwidget_ = WebView::create(delegate, dev_tools_client, NULL); |
| 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 |