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/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 | 1251 |
1252 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) { | 1252 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) { |
1253 link_under_cursor_ = base::UTF8ToUTF16(url); | 1253 link_under_cursor_ = base::UTF8ToUTF16(url); |
1254 } | 1254 } |
1255 | 1255 |
1256 void PepperPluginInstanceImpl::SetTextInputType(ui::TextInputType type) { | 1256 void PepperPluginInstanceImpl::SetTextInputType(ui::TextInputType type) { |
1257 text_input_type_ = type; | 1257 text_input_type_ = type; |
1258 render_frame_->PepperTextInputTypeChanged(this); | 1258 render_frame_->PepperTextInputTypeChanged(this); |
1259 } | 1259 } |
1260 | 1260 |
| 1261 void PepperPluginInstanceImpl::PostMessageToJavaScript(PP_Var message) { |
| 1262 message_channel_->PostMessageToJavaScript(message); |
| 1263 } |
| 1264 |
1261 base::string16 PepperPluginInstanceImpl::GetSelectedText(bool html) { | 1265 base::string16 PepperPluginInstanceImpl::GetSelectedText(bool html) { |
1262 // Keep a reference on the stack. See NOTE above. | 1266 // Keep a reference on the stack. See NOTE above. |
1263 scoped_refptr<PepperPluginInstanceImpl> ref(this); | 1267 scoped_refptr<PepperPluginInstanceImpl> ref(this); |
1264 if (!LoadSelectionInterface()) | 1268 if (!LoadSelectionInterface()) |
1265 return selected_text_; | 1269 return selected_text_; |
1266 | 1270 |
1267 PP_Var rv = plugin_selection_interface_->GetSelectedText(pp_instance(), | 1271 PP_Var rv = plugin_selection_interface_->GetSelectedText(pp_instance(), |
1268 PP_FromBool(html)); | 1272 PP_FromBool(html)); |
1269 StringVar* string = StringVar::FromPPVar(rv); | 1273 StringVar* string = StringVar::FromPPVar(rv); |
1270 base::string16 selection; | 1274 base::string16 selection; |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 return; | 2515 return; |
2512 } | 2516 } |
2513 double minimum_level = ZoomFactorToZoomLevel(minimum_factor); | 2517 double minimum_level = ZoomFactorToZoomLevel(minimum_factor); |
2514 double maximum_level = ZoomFactorToZoomLevel(maximum_factor); | 2518 double maximum_level = ZoomFactorToZoomLevel(maximum_factor); |
2515 render_frame_->render_view()->webview()->zoomLimitsChanged(minimum_level, | 2519 render_frame_->render_view()->webview()->zoomLimitsChanged(minimum_level, |
2516 maximum_level); | 2520 maximum_level); |
2517 } | 2521 } |
2518 | 2522 |
2519 void PepperPluginInstanceImpl::PostMessage(PP_Instance instance, | 2523 void PepperPluginInstanceImpl::PostMessage(PP_Instance instance, |
2520 PP_Var message) { | 2524 PP_Var message) { |
2521 message_channel_->PostMessageToJavaScript(message); | 2525 PostMessageToJavaScript(message); |
2522 } | 2526 } |
2523 | 2527 |
2524 PP_Bool PepperPluginInstanceImpl::SetCursor(PP_Instance instance, | 2528 PP_Bool PepperPluginInstanceImpl::SetCursor(PP_Instance instance, |
2525 PP_MouseCursor_Type type, | 2529 PP_MouseCursor_Type type, |
2526 PP_Resource image, | 2530 PP_Resource image, |
2527 const PP_Point* hot_spot) { | 2531 const PP_Point* hot_spot) { |
2528 if (!ValidateSetCursorParams(type, image, hot_spot)) | 2532 if (!ValidateSetCursorParams(type, image, hot_spot)) |
2529 return PP_FALSE; | 2533 return PP_FALSE; |
2530 | 2534 |
2531 if (type != PP_MOUSECURSOR_TYPE_CUSTOM) { | 2535 if (type != PP_MOUSECURSOR_TYPE_CUSTOM) { |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 // Running out-of-process. Initiate an IPC call to notify the plugin | 3138 // Running out-of-process. Initiate an IPC call to notify the plugin |
3135 // process. | 3139 // process. |
3136 ppapi::proxy::HostDispatcher* dispatcher = | 3140 ppapi::proxy::HostDispatcher* dispatcher = |
3137 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3141 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3138 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3142 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3139 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3143 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3140 } | 3144 } |
3141 } | 3145 } |
3142 | 3146 |
3143 } // namespace content | 3147 } // namespace content |
OLD | NEW |