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.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return browser_plugin::kPermissionTypeMedia; | 103 return browser_plugin::kPermissionTypeMedia; |
104 case BrowserPluginPermissionTypeNewWindow: | 104 case BrowserPluginPermissionTypeNewWindow: |
105 return browser_plugin::kPermissionTypeNewWindow; | 105 return browser_plugin::kPermissionTypeNewWindow; |
106 case BrowserPluginPermissionTypePointerLock: | 106 case BrowserPluginPermissionTypePointerLock: |
107 return browser_plugin::kPermissionTypePointerLock; | 107 return browser_plugin::kPermissionTypePointerLock; |
108 case BrowserPluginPermissionTypeUnknown: | 108 case BrowserPluginPermissionTypeUnknown: |
109 default: | 109 default: |
110 NOTREACHED(); | 110 NOTREACHED(); |
111 break; | 111 break; |
112 } | 112 } |
113 return ""; | 113 return std::string(); |
114 } | 114 } |
115 | 115 |
116 typedef std::map<WebKit::WebPluginContainer*, | 116 typedef std::map<WebKit::WebPluginContainer*, |
117 BrowserPlugin*> PluginContainerMap; | 117 BrowserPlugin*> PluginContainerMap; |
118 static base::LazyInstance<PluginContainerMap> g_plugin_container_map = | 118 static base::LazyInstance<PluginContainerMap> g_plugin_container_map = |
119 LAZY_INSTANCE_INITIALIZER; | 119 LAZY_INSTANCE_INITIALIZER; |
120 | 120 |
121 } // namespace | 121 } // namespace |
122 | 122 |
123 BrowserPlugin::BrowserPlugin( | 123 BrowserPlugin::BrowserPlugin( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 if (!container()) | 220 if (!container()) |
221 return; | 221 return; |
222 | 222 |
223 container()->element().removeAttribute( | 223 container()->element().removeAttribute( |
224 WebKit::WebString::fromUTF8(attribute_name)); | 224 WebKit::WebString::fromUTF8(attribute_name)); |
225 } | 225 } |
226 | 226 |
227 std::string BrowserPlugin::GetDOMAttributeValue( | 227 std::string BrowserPlugin::GetDOMAttributeValue( |
228 const std::string& attribute_name) const { | 228 const std::string& attribute_name) const { |
229 if (!container()) | 229 if (!container()) |
230 return ""; | 230 return std::string(); |
231 | 231 |
232 return container()->element().getAttribute( | 232 return container()->element().getAttribute( |
233 WebKit::WebString::fromUTF8(attribute_name)).utf8(); | 233 WebKit::WebString::fromUTF8(attribute_name)).utf8(); |
234 } | 234 } |
235 | 235 |
236 bool BrowserPlugin::HasDOMAttribute(const std::string& attribute_name) const { | 236 bool BrowserPlugin::HasDOMAttribute(const std::string& attribute_name) const { |
237 if (!container()) | 237 if (!container()) |
238 return false; | 238 return false; |
239 | 239 |
240 return container()->element().hasAttribute( | 240 return container()->element().hasAttribute( |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 const WebKit::WebMouseEvent& event) { | 1536 const WebKit::WebMouseEvent& event) { |
1537 browser_plugin_manager()->Send( | 1537 browser_plugin_manager()->Send( |
1538 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 1538 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
1539 instance_id_, | 1539 instance_id_, |
1540 plugin_rect_, | 1540 plugin_rect_, |
1541 &event)); | 1541 &event)); |
1542 return true; | 1542 return true; |
1543 } | 1543 } |
1544 | 1544 |
1545 } // namespace content | 1545 } // namespace content |
OLD | NEW |