| 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 "webkit/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <fontconfig/fontconfig.h> | 9 #include <fontconfig/fontconfig.h> |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 if (GTK_WIDGET_TOPLEVEL(toplevel)) | 459 if (GTK_WIDGET_TOPLEVEL(toplevel)) |
| 460 gtk_window_set_focus(GTK_WINDOW(toplevel), NULL); | 460 gtk_window_set_focus(GTK_WINDOW(toplevel), NULL); |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 | 463 |
| 464 void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { | 464 void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { |
| 465 RemoveWindowFromList(windowHandle); | 465 RemoveWindowFromList(windowHandle); |
| 466 gtk_widget_destroy(GTK_WIDGET(windowHandle)); | 466 gtk_widget_destroy(GTK_WIDGET(windowHandle)); |
| 467 } | 467 } |
| 468 | 468 |
| 469 WebWidget* TestShell::CreatePopupWidget(WebView* webview) { | 469 WebWidget* TestShell::CreatePopupWidget() { |
| 470 GtkWidget* popupwindow = gtk_window_new(GTK_WINDOW_POPUP); | 470 GtkWidget* popupwindow = gtk_window_new(GTK_WINDOW_POPUP); |
| 471 GtkWidget* vbox = gtk_vbox_new(FALSE, 0); | 471 GtkWidget* vbox = gtk_vbox_new(FALSE, 0); |
| 472 WebWidgetHost* host = WebWidgetHost::Create(vbox, popup_delegate_.get()); | 472 WebWidgetHost* host = WebWidgetHost::Create(vbox, popup_delegate_.get()); |
| 473 gtk_container_add(GTK_CONTAINER(popupwindow), vbox); | 473 gtk_container_add(GTK_CONTAINER(popupwindow), vbox); |
| 474 m_popupHost = host; | 474 m_popupHost = host; |
| 475 | 475 |
| 476 // Grab all input to the test shell and funnel it to the popup. | 476 // Grab all input to the test shell and funnel it to the popup. |
| 477 // The popup will detect if mouseclicks are outside its bounds and destroy | 477 // The popup will detect if mouseclicks are outside its bounds and destroy |
| 478 // itself if so. Clicks that are outside the test_shell window will destroy | 478 // itself if so. Clicks that are outside the test_shell window will destroy |
| 479 // the popup by taking focus away from the main window. | 479 // the popup by taking focus away from the main window. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 break; | 669 break; |
| 670 } | 670 } |
| 671 return TestShell::NetResourceProvider(resource_id); | 671 return TestShell::NetResourceProvider(resource_id); |
| 672 } | 672 } |
| 673 | 673 |
| 674 void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { | 674 void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { |
| 675 NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); | 675 NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); |
| 676 } | 676 } |
| 677 | 677 |
| 678 } // namespace webkit_glue | 678 } // namespace webkit_glue |
| OLD | NEW |