summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebSettings.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-19 10:57:31 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-19 10:57:31 -0800
commit11ecc8563736f4aaf10c0ae07d7cb814e4c3fcd5 (patch)
tree3b1aeab0a98bccaf94553de9dfad49513f794de9 /WebKit/android/jni/WebSettings.cpp
parentc9c497faa69a20ac6ff0360281f8896e373a79f9 (diff)
downloadexternal_webkit-11ecc8563736f4aaf10c0ae07d7cb814e4c3fcd5.zip
external_webkit-11ecc8563736f4aaf10c0ae07d7cb814e4c3fcd5.tar.gz
external_webkit-11ecc8563736f4aaf10c0ae07d7cb814e4c3fcd5.tar.bz2
auto import from //branches/cupcake/...@132276
Diffstat (limited to 'WebKit/android/jni/WebSettings.cpp')
-rw-r--r--WebKit/android/jni/WebSettings.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp
index 9860996..855abdd 100644
--- a/WebKit/android/jni/WebSettings.cpp
+++ b/WebKit/android/jni/WebSettings.cpp
@@ -279,15 +279,35 @@ public:
str = (jstring)env->GetObjectField(obj, gFieldIds->mPluginsPath);
if (str) {
WebCore::String pluginsPath = to_string(env, str);
- s->setPluginsPath(pluginsPath);
- // Set the plugin directories to this single entry.
- Vector< ::WebCore::String > paths(1);
- paths[0] = pluginsPath;
- pluginDatabase->setPluginDirectories(paths);
- // Set the home directory for plugin temporary files
- WebCore::sPluginPath = paths[0];
- // Reload plugins.
- pluginDatabase->refresh();
+ // When a new browser Tab is created, the corresponding
+ // Java WebViewCore object will sync (with the native
+ // side) its associated WebSettings at initialization
+ // time. However, at that point, the WebSettings object's
+ // mPluginsPaths member is set to the empty string. The
+ // real plugin path will be set later by the tab and the
+ // WebSettings will be synced again.
+ //
+ // There is no point in instructing WebCore's
+ // PluginDatabase instance to set the plugin path to the
+ // empty string. Furthermore, if the PluginDatabase
+ // instance is already initialized, setting the path to
+ // the empty string will cause the PluginDatabase to
+ // forget about the plugin files it has already
+ // inspected. When the path is subsequently set to the
+ // correct value, the PluginDatabase will attempt to load
+ // and initialize plugins that are already loaded and
+ // initialized.
+ if (pluginsPath.length()) {
+ s->setPluginsPath(pluginsPath);
+ // Set the plugin directories to this single entry.
+ Vector< ::WebCore::String > paths(1);
+ paths[0] = pluginsPath;
+ pluginDatabase->setPluginDirectories(paths);
+ // Set the home directory for plugin temporary files
+ WebCore::sPluginPath = paths[0];
+ // Reload plugins.
+ pluginDatabase->refresh();
+ }
}
#endif