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 "content/renderer/browser_plugin/browser_plugin_bindings.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 using WebKit::WebDOMMessageEvent; | 32 using WebKit::WebDOMMessageEvent; |
33 using WebKit::WebPluginContainer; | 33 using WebKit::WebPluginContainer; |
34 using WebKit::WebString; | 34 using WebKit::WebString; |
35 | 35 |
36 namespace content { | 36 namespace content { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 BrowserPluginBindings* GetBindings(NPObject* object) { | 40 BrowserPluginBindings* GetBindings(NPObject* object) { |
41 return static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(object)-> | 41 return static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(object)-> |
42 message_channel; | 42 message_channel.get(); |
43 } | 43 } |
44 | 44 |
45 std::string StringFromNPVariant(const NPVariant& variant) { | 45 std::string StringFromNPVariant(const NPVariant& variant) { |
46 if (!NPVARIANT_IS_STRING(variant)) | 46 if (!NPVARIANT_IS_STRING(variant)) |
47 return std::string(); | 47 return std::string(); |
48 const NPString& np_string = NPVARIANT_TO_STRING(variant); | 48 const NPString& np_string = NPVARIANT_TO_STRING(variant); |
49 return std::string(np_string.UTF8Characters, np_string.UTF8Length); | 49 return std::string(np_string.UTF8Characters, np_string.UTF8Length); |
50 } | 50 } |
51 | 51 |
52 bool StringToNPVariant(const std::string &in, NPVariant *variant) { | 52 bool StringToNPVariant(const std::string &in, NPVariant *variant) { |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 for (PropertyBindingList::iterator iter = property_bindings_.begin(); | 938 for (PropertyBindingList::iterator iter = property_bindings_.begin(); |
939 iter != property_bindings_.end(); | 939 iter != property_bindings_.end(); |
940 ++iter) { | 940 ++iter) { |
941 if ((*iter)->MatchesName(name)) | 941 if ((*iter)->MatchesName(name)) |
942 return (*iter)->GetProperty(this, result); | 942 return (*iter)->GetProperty(this, result); |
943 } | 943 } |
944 return false; | 944 return false; |
945 } | 945 } |
946 | 946 |
947 } // namespace content | 947 } // namespace content |
OLD | NEW |