Chromium Code Reviews| 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 6194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6205 selection_rect, | 6205 selection_rect, |
| 6206 ordinal, | 6206 ordinal, |
| 6207 final_status_update)); | 6207 final_status_update)); |
| 6208 } | 6208 } |
| 6209 | 6209 |
| 6210 #if defined(ENABLE_PLUGINS) | 6210 #if defined(ENABLE_PLUGINS) |
| 6211 void RenderFrameImpl::PepperInstanceCreated( | 6211 void RenderFrameImpl::PepperInstanceCreated( |
| 6212 PepperPluginInstanceImpl* instance) { | 6212 PepperPluginInstanceImpl* instance) { |
| 6213 active_pepper_instances_.insert(instance); | 6213 active_pepper_instances_.insert(instance); |
| 6214 | 6214 |
| 6215 Send(new FrameHostMsg_PepperInstanceCreated(routing_id_)); | 6215 Send(new FrameHostMsg_PepperInstanceCreated( |
| 6216 routing_id_, instance->pp_instance())); | |
| 6216 } | 6217 } |
| 6217 | 6218 |
| 6218 void RenderFrameImpl::PepperInstanceDeleted( | 6219 void RenderFrameImpl::PepperInstanceDeleted( |
| 6219 PepperPluginInstanceImpl* instance) { | 6220 PepperPluginInstanceImpl* instance) { |
| 6220 active_pepper_instances_.erase(instance); | 6221 active_pepper_instances_.erase(instance); |
| 6221 | 6222 |
| 6222 if (pepper_last_mouse_event_target_ == instance) | 6223 if (pepper_last_mouse_event_target_ == instance) |
| 6223 pepper_last_mouse_event_target_ = nullptr; | 6224 pepper_last_mouse_event_target_ = nullptr; |
| 6224 if (focused_pepper_plugin_ == instance) | 6225 if (focused_pepper_plugin_ == instance) |
| 6225 PepperFocusChanged(instance, false); | 6226 PepperFocusChanged(instance, false); |
| 6226 | 6227 |
| 6227 RenderFrameImpl* const render_frame = instance->render_frame(); | 6228 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6228 if (render_frame) | 6229 if (render_frame) |
| 6229 render_frame->Send( | 6230 render_frame->Send( |
| 6230 new FrameHostMsg_PepperInstanceDeleted(render_frame->GetRoutingID())); | 6231 new FrameHostMsg_PepperInstanceDeleted( |
| 6232 render_frame->GetRoutingID(), | |
| 6233 instance->pp_instance())); | |
| 6231 } | 6234 } |
| 6232 | 6235 |
| 6233 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, | 6236 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, |
| 6234 bool focused) { | 6237 bool focused) { |
| 6235 if (focused) | 6238 if (focused) |
| 6236 focused_pepper_plugin_ = instance; | 6239 focused_pepper_plugin_ = instance; |
| 6237 else if (focused_pepper_plugin_ == instance) | 6240 else if (focused_pepper_plugin_ == instance) |
| 6238 focused_pepper_plugin_ = nullptr; | 6241 focused_pepper_plugin_ = nullptr; |
| 6239 | 6242 |
| 6240 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 6243 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, |
| 6241 ChangeSource::FROM_NON_IME); | 6244 ChangeSource::FROM_NON_IME); |
| 6242 GetRenderWidget()->UpdateSelectionBounds(); | 6245 GetRenderWidget()->UpdateSelectionBounds(); |
| 6243 } | 6246 } |
| 6244 | 6247 |
| 6245 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { | 6248 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { |
| 6246 // TODO(zqzhang): send PepperStartsPlayback message to the browser. | 6249 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6250 if (render_frame) | |
|
mlamouri (slow - plz ping)
2016/06/24 15:33:32
style: add { }
Zhiqiang Zhang (Slow)
2016/06/24 17:43:21
Done.
| |
| 6251 render_frame->Send( | |
| 6252 new FrameHostMsg_PepperStartsPlayback( | |
| 6253 render_frame->GetRoutingID(), | |
| 6254 instance->pp_instance())); | |
| 6247 } | 6255 } |
| 6248 | 6256 |
| 6249 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) { | 6257 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) { |
| 6250 // TODO(zqzhang): send PepperStopsPlayback message to the browser. | 6258 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6259 if (render_frame) | |
|
mlamouri (slow - plz ping)
2016/06/24 15:33:32
style: add { }
Zhiqiang Zhang (Slow)
2016/06/24 17:43:21
Done.
| |
| 6260 render_frame->Send( | |
| 6261 new FrameHostMsg_PepperStopsPlayback( | |
| 6262 render_frame->GetRoutingID(), | |
| 6263 instance->pp_instance())); | |
| 6251 } | 6264 } |
| 6252 | 6265 |
| 6253 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { | 6266 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { |
| 6254 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( | 6267 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( |
| 6255 PepperPluginInstance::Get(pp_instance)); | 6268 PepperPluginInstance::Get(pp_instance)); |
| 6256 if (instance) | 6269 if (instance) |
| 6257 instance->audio_controller().SetVolume(volume); | 6270 instance->audio_controller().SetVolume(volume); |
| 6258 } | 6271 } |
| 6259 #endif // ENABLE_PLUGINS | 6272 #endif // ENABLE_PLUGINS |
| 6260 | 6273 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 6273 // event target. Potentially a Pepper plugin will receive the event. | 6286 // event target. Potentially a Pepper plugin will receive the event. |
| 6274 // In order to tell whether a plugin gets the last mouse event and which it | 6287 // In order to tell whether a plugin gets the last mouse event and which it |
| 6275 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6288 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6276 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6289 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6277 // |pepper_last_mouse_event_target_|. | 6290 // |pepper_last_mouse_event_target_|. |
| 6278 pepper_last_mouse_event_target_ = nullptr; | 6291 pepper_last_mouse_event_target_ = nullptr; |
| 6279 #endif | 6292 #endif |
| 6280 } | 6293 } |
| 6281 | 6294 |
| 6282 } // namespace content | 6295 } // namespace content |
| OLD | NEW |