| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 307 } |
| 308 | 308 |
| 309 void TestShell::PlatformCleanUp() { | 309 void TestShell::PlatformCleanUp() { |
| 310 if (m_mainWnd) { | 310 if (m_mainWnd) { |
| 311 // Disconnect our MainWindowDestroyed handler so that we don't go through | 311 // Disconnect our MainWindowDestroyed handler so that we don't go through |
| 312 // the shutdown process more than once. | 312 // the shutdown process more than once. |
| 313 g_signal_handlers_disconnect_by_func(m_mainWnd, | 313 g_signal_handlers_disconnect_by_func(m_mainWnd, |
| 314 reinterpret_cast<gpointer>(MainWindowDestroyed), this); | 314 reinterpret_cast<gpointer>(MainWindowDestroyed), this); |
| 315 gtk_widget_destroy(GTK_WIDGET(m_mainWnd)); | 315 gtk_widget_destroy(GTK_WIDGET(m_mainWnd)); |
| 316 } | 316 } |
| 317 FcFini(); |
| 317 } | 318 } |
| 318 | 319 |
| 319 bool TestShell::Initialize(const GURL& starting_url) { | 320 bool TestShell::Initialize(const GURL& starting_url) { |
| 320 m_mainWnd = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | 321 m_mainWnd = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); |
| 321 gtk_window_set_title(m_mainWnd, "Test Shell"); | 322 gtk_window_set_title(m_mainWnd, "Test Shell"); |
| 322 // Null out m_mainWnd when it is destroyed so we don't destroy it twice. | 323 // Null out m_mainWnd when it is destroyed so we don't destroy it twice. |
| 323 g_signal_connect(G_OBJECT(m_mainWnd), "destroy", | 324 g_signal_connect(G_OBJECT(m_mainWnd), "destroy", |
| 324 G_CALLBACK(gtk_widget_destroyed), &m_mainWnd); | 325 G_CALLBACK(gtk_widget_destroyed), &m_mainWnd); |
| 325 g_signal_connect(G_OBJECT(m_mainWnd), "destroy", | 326 g_signal_connect(G_OBJECT(m_mainWnd), "destroy", |
| 326 G_CALLBACK(MainWindowDestroyed), this); | 327 G_CALLBACK(MainWindowDestroyed), this); |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 break; | 673 break; |
| 673 } | 674 } |
| 674 return TestShell::NetResourceProvider(resource_id); | 675 return TestShell::NetResourceProvider(resource_id); |
| 675 } | 676 } |
| 676 | 677 |
| 677 void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { | 678 void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { |
| 678 NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); | 679 NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); |
| 679 } | 680 } |
| 680 | 681 |
| 681 } // namespace webkit_glue | 682 } // namespace webkit_glue |
| OLD | NEW |