| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 | 6 |
| 7 #include "webkit/tools/test_shell/webview_host.h" | 7 #include "webkit/tools/test_shell/webview_host.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/gfx/rect.h" | 10 #include "base/gfx/rect.h" |
| 11 #include "base/gfx/size.h" | 11 #include "base/gfx/size.h" |
| 12 #include "skia/ext/platform_canvas.h" | 12 #include "skia/ext/platform_canvas.h" |
| 13 #include "webkit/glue/plugins/gtk_plugin_container.h" | 13 #include "webkit/glue/plugins/gtk_plugin_container.h" |
| 14 #include "webkit/glue/webview.h" | 14 #include "webkit/glue/webview.h" |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 WebViewHost* WebViewHost::Create(GtkWidget* parent_view, | 17 WebViewHost* WebViewHost::Create(GtkWidget* parent_view, |
| 18 WebViewDelegate* delegate, | 18 WebViewDelegate* delegate, |
| 19 const WebPreferences& prefs) { | 19 const WebPreferences& prefs) { |
| 20 WebViewHost* host = new WebViewHost(); | 20 WebViewHost* host = new WebViewHost(); |
| 21 | 21 |
| 22 host->view_ = WebWidgetHost::CreateWidget(parent_view, host); | 22 host->view_ = WebWidgetHost::CreateWidget(parent_view, host); |
| 23 host->plugin_container_manager_.set_host_widget(host->view_); | 23 host->plugin_container_manager_.set_host_widget(host->view_); |
| 24 g_object_set_data(G_OBJECT(host->view_), "webwidgethost", host); | 24 g_object_set_data(G_OBJECT(host->view_), "webwidgethost", host); |
| 25 | 25 |
| 26 host->webwidget_ = WebView::Create(delegate, prefs); | 26 host->webwidget_ = WebView::Create(delegate, prefs); |
| 27 host->webwidget_->Layout(); | 27 host->webwidget_->layout(); |
| 28 | 28 |
| 29 return host; | 29 return host; |
| 30 } | 30 } |
| 31 | 31 |
| 32 WebView* WebViewHost::webview() const { | 32 WebView* WebViewHost::webview() const { |
| 33 return static_cast<WebView*>(webwidget_); | 33 return static_cast<WebView*>(webwidget_); |
| 34 } | 34 } |
| 35 | 35 |
| 36 GdkNativeWindow WebViewHost::CreatePluginContainer() { | 36 GdkNativeWindow WebViewHost::CreatePluginContainer() { |
| 37 return plugin_container_manager_.CreatePluginContainer(); | 37 return plugin_container_manager_.CreatePluginContainer(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void WebViewHost::OnPluginWindowDestroyed(GdkNativeWindow id) { | 40 void WebViewHost::OnPluginWindowDestroyed(GdkNativeWindow id) { |
| 41 plugin_container_manager_.DestroyPluginContainer(id); | 41 plugin_container_manager_.DestroyPluginContainer(id); |
| 42 } | 42 } |
| OLD | NEW |