OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugins/npapi/plugin_instance.h" | 5 #include "webkit/plugins/npapi/plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 NPObject *PluginInstance::GetPluginScriptableObject() { | 172 NPObject *PluginInstance::GetPluginScriptableObject() { |
173 NPObject *value = NULL; | 173 NPObject *value = NULL; |
174 NPError error = NPP_GetValue(NPPVpluginScriptableNPObject, &value); | 174 NPError error = NPP_GetValue(NPPVpluginScriptableNPObject, &value); |
175 if (error != NPERR_NO_ERROR || value == NULL) | 175 if (error != NPERR_NO_ERROR || value == NULL) |
176 return NULL; | 176 return NULL; |
177 return value; | 177 return value; |
178 } | 178 } |
179 | 179 |
180 bool PluginInstance::GetFormValue(string16* value) { | 180 bool PluginInstance::GetFormValue(base::string16* value) { |
181 // Plugins will allocate memory for the return value by using NPN_MemAlloc(). | 181 // Plugins will allocate memory for the return value by using NPN_MemAlloc(). |
182 char *plugin_value = NULL; | 182 char *plugin_value = NULL; |
183 NPError error = NPP_GetValue(NPPVformValue, &plugin_value); | 183 NPError error = NPP_GetValue(NPPVformValue, &plugin_value); |
184 if (error != NPERR_NO_ERROR || !plugin_value) { | 184 if (error != NPERR_NO_ERROR || !plugin_value) { |
185 return false; | 185 return false; |
186 } | 186 } |
187 // Assumes the result is UTF8 text, as Firefox does. | 187 // Assumes the result is UTF8 text, as Firefox does. |
188 *value = UTF8ToUTF16(plugin_value); | 188 *value = UTF8ToUTF16(plugin_value); |
189 host_->host_functions()->memfree(plugin_value); | 189 host_->host_functions()->memfree(plugin_value); |
190 return true; | 190 return true; |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 plugin_stream->UpdateUrl( | 681 plugin_stream->UpdateUrl( |
682 plugin_stream->pending_redirect_url().c_str()); | 682 plugin_stream->pending_redirect_url().c_str()); |
683 } | 683 } |
684 break; | 684 break; |
685 } | 685 } |
686 } | 686 } |
687 } | 687 } |
688 | 688 |
689 } // namespace npapi | 689 } // namespace npapi |
690 } // namespace webkit | 690 } // namespace webkit |
OLD | NEW |