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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include "app/win_util.h" | 8 #include "app/win_util.h" |
9 #endif | 9 #endif |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 if (parsed_command_line.HasSwitch(switches::kPluginStartupDialog)) { | 63 if (parsed_command_line.HasSwitch(switches::kPluginStartupDialog)) { |
64 std::wstring title = chrome::kBrowserAppName; | 64 std::wstring title = chrome::kBrowserAppName; |
65 title += L" plugin"; // makes attaching to process easier | 65 title += L" plugin"; // makes attaching to process easier |
66 win_util::MessageBox(NULL, L"plugin starting...", title, | 66 win_util::MessageBox(NULL, L"plugin starting...", title, |
67 MB_OK | MB_SETFOREGROUND); | 67 MB_OK | MB_SETFOREGROUND); |
68 } | 68 } |
69 #else | 69 #else |
| 70 #if defined(OS_LINUX) |
| 71 { |
| 72 // XEmbed plugins assume they are hosted in a Gtk application, so we need |
| 73 // to initialize Gtk in the plugin process. |
| 74 const std::vector<std::string>& args = parameters.command_line_.argv(); |
| 75 int argc = args.size(); |
| 76 scoped_array<const char *> argv(new const char *[argc + 1]); |
| 77 for (int i = 0; i < argc; ++i) { |
| 78 argv[i] = args[i].c_str(); |
| 79 } |
| 80 argv[argc] = NULL; |
| 81 const char **argv_pointer = argv.get(); |
| 82 gtk_init(&argc, const_cast<char***>(&argv_pointer)); |
| 83 } |
| 84 #endif |
70 NOTIMPLEMENTED() << " non-windows startup, plugin startup dialog etc."; | 85 NOTIMPLEMENTED() << " non-windows startup, plugin startup dialog etc."; |
71 #endif | 86 #endif |
72 | 87 |
73 { | 88 { |
74 ChildProcess plugin_process(new PluginThread()); | 89 ChildProcess plugin_process(new PluginThread()); |
75 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
76 if (!no_sandbox && target_services) | 91 if (!no_sandbox && target_services) |
77 target_services->LowerToken(); | 92 target_services->LowerToken(); |
78 | 93 |
79 if (sandbox_test_module) { | 94 if (sandbox_test_module) { |
(...skipping 15 matching lines...) Expand all Loading... |
95 | 110 |
96 MessageLoop::current()->Run(); | 111 MessageLoop::current()->Run(); |
97 } | 112 } |
98 | 113 |
99 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
100 CoUninitialize(); | 115 CoUninitialize(); |
101 #endif | 116 #endif |
102 | 117 |
103 return 0; | 118 return 0; |
104 } | 119 } |
OLD | NEW |