| 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 "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(OS_LINUX) | 9 #if defined(OS_LINUX) |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 if (!plugin_thread) | 200 if (!plugin_thread) |
| 201 return false; | 201 return false; |
| 202 | 202 |
| 203 plugin_thread->Send( | 203 plugin_thread->Send( |
| 204 new PluginProcessHostMsg_GetPluginFinderUrl(plugin_finder_url)); | 204 new PluginProcessHostMsg_GetPluginFinderUrl(plugin_finder_url)); |
| 205 DCHECK(!plugin_finder_url->empty()); | 205 DCHECK(!plugin_finder_url->empty()); |
| 206 return true; | 206 return true; |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool IsDefaultPluginEnabled() { | 209 bool IsDefaultPluginEnabled() { |
| 210 #if defined(OS_WIN) || defined(OS_MACOSX) | |
| 211 return true; | 210 return true; |
| 212 #elif defined(OS_LINUX) | |
| 213 // http://code.google.com/p/chromium/issues/detail?id=10952 | |
| 214 return false; | |
| 215 #endif | |
| 216 } | 211 } |
| 217 | 212 |
| 218 // Dispatch the resolve proxy resquest to the right code, depending on which | 213 // Dispatch the resolve proxy resquest to the right code, depending on which |
| 219 // process the plugin is running in {renderer, browser, plugin}. | 214 // process the plugin is running in {renderer, browser, plugin}. |
| 220 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) { | 215 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) { |
| 221 int net_error; | 216 int net_error; |
| 222 std::string proxy_result; | 217 std::string proxy_result; |
| 223 | 218 |
| 224 bool result; | 219 bool result; |
| 225 if (IsPluginProcess()) { | 220 if (IsPluginProcess()) { |
| 226 result = PluginThread::current()->Send( | 221 result = PluginThread::current()->Send( |
| 227 new PluginProcessHostMsg_ResolveProxy(url, &net_error, &proxy_result)); | 222 new PluginProcessHostMsg_ResolveProxy(url, &net_error, &proxy_result)); |
| 228 } else { | 223 } else { |
| 229 result = RenderThread::current()->Send( | 224 result = RenderThread::current()->Send( |
| 230 new ViewHostMsg_ResolveProxy(url, &net_error, &proxy_result)); | 225 new ViewHostMsg_ResolveProxy(url, &net_error, &proxy_result)); |
| 231 } | 226 } |
| 232 | 227 |
| 233 if (!result || net_error != net::OK) | 228 if (!result || net_error != net::OK) |
| 234 return false; | 229 return false; |
| 235 | 230 |
| 236 *proxy_list = proxy_result; | 231 *proxy_list = proxy_result; |
| 237 return true; | 232 return true; |
| 238 } | 233 } |
| 239 | 234 |
| 240 } // namespace webkit_glue | 235 } // namespace webkit_glue |
| OLD | NEW |