OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/plugin/plugin_thread.h" | 5 #include "chrome/plugin/plugin_thread.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(USE_X11) | 9 #if defined(USE_X11) |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "net/base/net_errors.h" | 31 #include "net/base/net_errors.h" |
32 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
33 #include "webkit/plugins/npapi/plugin_lib.h" | 33 #include "webkit/plugins/npapi/plugin_lib.h" |
34 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 34 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
35 | 35 |
36 #if defined(TOOLKIT_USES_GTK) | 36 #if defined(TOOLKIT_USES_GTK) |
37 #include "gfx/gtk_util.h" | 37 #include "gfx/gtk_util.h" |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(USE_X11) | 40 #if defined(USE_X11) |
41 #include "app/x11_util.h" | 41 #include "ui/base/x/x11_util.h" |
42 #elif defined(OS_MACOSX) | 42 #elif defined(OS_MACOSX) |
43 #include "app/l10n_util.h" | 43 #include "app/l10n_util.h" |
44 #include "base/mac/mac_util.h" | 44 #include "base/mac/mac_util.h" |
45 #include "base/mac/scoped_cftyperef.h" | 45 #include "base/mac/scoped_cftyperef.h" |
46 #include "base/sys_string_conversions.h" | 46 #include "base/sys_string_conversions.h" |
47 #include "grit/chromium_strings.h" | 47 #include "grit/chromium_strings.h" |
48 #endif | 48 #endif |
49 | 49 |
50 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( | 50 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( |
51 base::LINKER_INITIALIZED); | 51 base::LINKER_INITIALIZED); |
(...skipping 17 matching lines...) Expand all Loading... |
69 setenv("GDK_NATIVE_WINDOWS", "1", 1); | 69 setenv("GDK_NATIVE_WINDOWS", "1", 1); |
70 | 70 |
71 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 71 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
72 | 72 |
73 // GTK after 2.18 resets the environment variable. But if we're using | 73 // GTK after 2.18 resets the environment variable. But if we're using |
74 // nspluginwrapper, that means it'll spawn its subprocess without the | 74 // nspluginwrapper, that means it'll spawn its subprocess without the |
75 // environment variable! So set it again. | 75 // environment variable! So set it again. |
76 setenv("GDK_NATIVE_WINDOWS", "1", 1); | 76 setenv("GDK_NATIVE_WINDOWS", "1", 1); |
77 } | 77 } |
78 | 78 |
79 x11_util::SetDefaultX11ErrorHandlers(); | 79 ui::SetDefaultX11ErrorHandlers(); |
80 #endif | 80 #endif |
81 | 81 |
82 PatchNPNFunctions(); | 82 PatchNPNFunctions(); |
83 | 83 |
84 // Preload the library to avoid loading, unloading then reloading | 84 // Preload the library to avoid loading, unloading then reloading |
85 preloaded_plugin_module_ = base::LoadNativeLibrary(plugin_path_); | 85 preloaded_plugin_module_ = base::LoadNativeLibrary(plugin_path_); |
86 | 86 |
87 ChromePluginLib::Create(plugin_path_, GetCPBrowserFuncsForPlugin()); | 87 ChromePluginLib::Create(plugin_path_, GetCPBrowserFuncsForPlugin()); |
88 | 88 |
89 scoped_refptr<webkit::npapi::PluginLib> plugin( | 89 scoped_refptr<webkit::npapi::PluginLib> plugin( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 | 229 |
230 if (!result || net_error != net::OK) | 230 if (!result || net_error != net::OK) |
231 return false; | 231 return false; |
232 | 232 |
233 *proxy_list = proxy_result; | 233 *proxy_list = proxy_result; |
234 return true; | 234 return true; |
235 } | 235 } |
236 | 236 |
237 } // namespace webkit_glue | 237 } // namespace webkit_glue |
OLD | NEW |