| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 6228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6239 selection_rect, | 6239 selection_rect, |
| 6240 ordinal, | 6240 ordinal, |
| 6241 final_status_update)); | 6241 final_status_update)); |
| 6242 } | 6242 } |
| 6243 | 6243 |
| 6244 #if defined(ENABLE_PLUGINS) | 6244 #if defined(ENABLE_PLUGINS) |
| 6245 void RenderFrameImpl::PepperInstanceCreated( | 6245 void RenderFrameImpl::PepperInstanceCreated( |
| 6246 PepperPluginInstanceImpl* instance) { | 6246 PepperPluginInstanceImpl* instance) { |
| 6247 active_pepper_instances_.insert(instance); | 6247 active_pepper_instances_.insert(instance); |
| 6248 | 6248 |
| 6249 Send(new FrameHostMsg_PepperInstanceCreated(routing_id_)); | 6249 Send(new FrameHostMsg_PepperInstanceCreated( |
| 6250 routing_id_, instance->pp_instance())); |
| 6250 } | 6251 } |
| 6251 | 6252 |
| 6252 void RenderFrameImpl::PepperInstanceDeleted( | 6253 void RenderFrameImpl::PepperInstanceDeleted( |
| 6253 PepperPluginInstanceImpl* instance) { | 6254 PepperPluginInstanceImpl* instance) { |
| 6254 active_pepper_instances_.erase(instance); | 6255 active_pepper_instances_.erase(instance); |
| 6255 | 6256 |
| 6256 if (pepper_last_mouse_event_target_ == instance) | 6257 if (pepper_last_mouse_event_target_ == instance) |
| 6257 pepper_last_mouse_event_target_ = nullptr; | 6258 pepper_last_mouse_event_target_ = nullptr; |
| 6258 if (focused_pepper_plugin_ == instance) | 6259 if (focused_pepper_plugin_ == instance) |
| 6259 PepperFocusChanged(instance, false); | 6260 PepperFocusChanged(instance, false); |
| 6260 | 6261 |
| 6261 RenderFrameImpl* const render_frame = instance->render_frame(); | 6262 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6262 if (render_frame) | 6263 if (render_frame) { |
| 6263 render_frame->Send( | 6264 render_frame->Send( |
| 6264 new FrameHostMsg_PepperInstanceDeleted(render_frame->GetRoutingID())); | 6265 new FrameHostMsg_PepperInstanceDeleted( |
| 6266 render_frame->GetRoutingID(), |
| 6267 instance->pp_instance())); |
| 6268 } |
| 6265 } | 6269 } |
| 6266 | 6270 |
| 6267 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, | 6271 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, |
| 6268 bool focused) { | 6272 bool focused) { |
| 6269 if (focused) | 6273 if (focused) |
| 6270 focused_pepper_plugin_ = instance; | 6274 focused_pepper_plugin_ = instance; |
| 6271 else if (focused_pepper_plugin_ == instance) | 6275 else if (focused_pepper_plugin_ == instance) |
| 6272 focused_pepper_plugin_ = nullptr; | 6276 focused_pepper_plugin_ = nullptr; |
| 6273 | 6277 |
| 6274 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 6278 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, |
| 6275 ChangeSource::FROM_NON_IME); | 6279 ChangeSource::FROM_NON_IME); |
| 6276 GetRenderWidget()->UpdateSelectionBounds(); | 6280 GetRenderWidget()->UpdateSelectionBounds(); |
| 6277 } | 6281 } |
| 6278 | 6282 |
| 6279 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { | 6283 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { |
| 6280 // TODO(zqzhang): send PepperStartsPlayback message to the browser. | 6284 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6281 // See https://crbug.com/619084 | 6285 if (render_frame) { |
| 6286 render_frame->Send( |
| 6287 new FrameHostMsg_PepperStartsPlayback( |
| 6288 render_frame->GetRoutingID(), |
| 6289 instance->pp_instance())); |
| 6290 } |
| 6282 } | 6291 } |
| 6283 | 6292 |
| 6284 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) { | 6293 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) { |
| 6285 // TODO(zqzhang): send PepperStopsPlayback message to the browser. | 6294 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6286 // See https://crbug.com/619084 | 6295 if (render_frame) { |
| 6296 render_frame->Send( |
| 6297 new FrameHostMsg_PepperStopsPlayback( |
| 6298 render_frame->GetRoutingID(), |
| 6299 instance->pp_instance())); |
| 6300 } |
| 6287 } | 6301 } |
| 6288 | 6302 |
| 6289 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { | 6303 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { |
| 6290 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( | 6304 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( |
| 6291 PepperPluginInstance::Get(pp_instance)); | 6305 PepperPluginInstance::Get(pp_instance)); |
| 6292 if (instance) | 6306 if (instance) |
| 6293 instance->audio_controller().SetVolume(volume); | 6307 instance->audio_controller().SetVolume(volume); |
| 6294 } | 6308 } |
| 6295 #endif // ENABLE_PLUGINS | 6309 #endif // ENABLE_PLUGINS |
| 6296 | 6310 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 6309 // event target. Potentially a Pepper plugin will receive the event. | 6323 // event target. Potentially a Pepper plugin will receive the event. |
| 6310 // In order to tell whether a plugin gets the last mouse event and which it | 6324 // In order to tell whether a plugin gets the last mouse event and which it |
| 6311 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6325 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6312 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6326 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6313 // |pepper_last_mouse_event_target_|. | 6327 // |pepper_last_mouse_event_target_|. |
| 6314 pepper_last_mouse_event_target_ = nullptr; | 6328 pepper_last_mouse_event_target_ = nullptr; |
| 6315 #endif | 6329 #endif |
| 6316 } | 6330 } |
| 6317 | 6331 |
| 6318 } // namespace content | 6332 } // namespace content |
| OLD | NEW |