Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: webkit/tools/test_shell/webview_host_win.cc

Issue 15028002: Delete test_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add dummy test_shell build target. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "webkit/tools/test_shell/webview_host.h"
6
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
9 #include "ui/base/win/hwnd_util.h"
10 #include "ui/gfx/rect.h"
11 #include "ui/gfx/size.h"
12 #include "webkit/glue/webpreferences.h"
13 #include "webkit/tools/test_shell/test_webview_delegate.h"
14
15 using namespace WebKit;
16
17 static const wchar_t kWindowClassName[] = L"WebViewHost";
18
19 /*static*/
20 WebViewHost* WebViewHost::Create(HWND parent_view,
21 TestWebViewDelegate* delegate,
22 WebDevToolsAgentClient* dev_tools_client,
23 const WebPreferences& prefs) {
24 WebViewHost* host = new WebViewHost();
25
26 static bool registered_class = false;
27 if (!registered_class) {
28 WNDCLASSEX wcex = {0};
29 wcex.cbSize = sizeof(wcex);
30 wcex.style = CS_DBLCLKS;
31 wcex.lpfnWndProc = WebWidgetHost::WndProc;
32 wcex.hInstance = GetModuleHandle(NULL);
33 wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
34 wcex.lpszClassName = kWindowClassName;
35 RegisterClassEx(&wcex);
36 registered_class = true;
37 }
38
39 host->view_ = CreateWindow(kWindowClassName, NULL,
40 WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, 0, 0,
41 0, 0, parent_view, NULL,
42 GetModuleHandle(NULL), NULL);
43 ui::SetWindowUserData(host->view_, host);
44
45 host->webwidget_ = WebView::create(delegate);
46 host->webview()->setDevToolsAgentClient(dev_tools_client);
47 webkit_glue::ApplyWebPreferences(prefs, host->webview());
48 host->webview()->settings()->setExperimentalCSSGridLayoutEnabled(true);
49 host->webview()->initializeMainFrame(delegate);
50
51 return host;
52 }
53
54 WebView* WebViewHost::webview() const {
55 return static_cast<WebView*>(webwidget_);
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698