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