OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 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 <gtk/gtk.h> |
| 6 |
| 7 #include "webkit/tools/test_shell/webview_host.h" |
| 8 |
| 9 #include "base/gfx/platform_canvas.h" |
| 10 #include "base/gfx/rect.h" |
| 11 #include "base/gfx/size.h" |
| 12 #include "base/logging.h" |
| 13 #include "webkit/glue/webinputevent.h" |
| 14 #include "webkit/glue/webview.h" |
| 15 |
| 16 /*static*/ |
| 17 WebViewHost* WebViewHost::Create(GtkWidget* box, |
| 18 WebViewDelegate* delegate, |
| 19 const WebPreferences& prefs) { |
| 20 WebViewHost* host = new WebViewHost(); |
| 21 |
| 22 host->view_ = WebWidgetHost::CreateWindow(box, host); |
| 23 g_object_set_data(G_OBJECT(host->view_), "webwidgethost", host); |
| 24 |
| 25 host->webwidget_ = WebView::Create(delegate, prefs); |
| 26 host->webwidget_->Layout(); |
| 27 |
| 28 return host; |
| 29 } |
| 30 |
| 31 WebView* WebViewHost::webview() const { |
| 32 return static_cast<WebView*>(webwidget_); |
| 33 } |
OLD | NEW |