Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2060933002: Let Flash join and be controlled by media session (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pepper_to_contents
Patch Set: addressed Jochen's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 6225 matching lines...) Expand 10 before | Expand all | Expand 10 after
6236 selection_rect, 6236 selection_rect,
6237 ordinal, 6237 ordinal,
6238 final_status_update)); 6238 final_status_update));
6239 } 6239 }
6240 6240
6241 #if defined(ENABLE_PLUGINS) 6241 #if defined(ENABLE_PLUGINS)
6242 void RenderFrameImpl::PepperInstanceCreated( 6242 void RenderFrameImpl::PepperInstanceCreated(
6243 PepperPluginInstanceImpl* instance) { 6243 PepperPluginInstanceImpl* instance) {
6244 active_pepper_instances_.insert(instance); 6244 active_pepper_instances_.insert(instance);
6245 6245
6246 Send(new FrameHostMsg_PepperInstanceCreated(routing_id_)); 6246 Send(new FrameHostMsg_PepperInstanceCreated(
6247 routing_id_, instance->pp_instance()));
6247 } 6248 }
6248 6249
6249 void RenderFrameImpl::PepperInstanceDeleted( 6250 void RenderFrameImpl::PepperInstanceDeleted(
6250 PepperPluginInstanceImpl* instance) { 6251 PepperPluginInstanceImpl* instance) {
6251 active_pepper_instances_.erase(instance); 6252 active_pepper_instances_.erase(instance);
6252 6253
6253 if (pepper_last_mouse_event_target_ == instance) 6254 if (pepper_last_mouse_event_target_ == instance)
6254 pepper_last_mouse_event_target_ = nullptr; 6255 pepper_last_mouse_event_target_ = nullptr;
6255 if (focused_pepper_plugin_ == instance) 6256 if (focused_pepper_plugin_ == instance)
6256 PepperFocusChanged(instance, false); 6257 PepperFocusChanged(instance, false);
6257 6258
6258 RenderFrameImpl* const render_frame = instance->render_frame(); 6259 RenderFrameImpl* const render_frame = instance->render_frame();
6259 if (render_frame) 6260 if (render_frame) {
6260 render_frame->Send( 6261 render_frame->Send(
6261 new FrameHostMsg_PepperInstanceDeleted(render_frame->GetRoutingID())); 6262 new FrameHostMsg_PepperInstanceDeleted(
6263 render_frame->GetRoutingID(),
6264 instance->pp_instance()));
6265 }
6262 } 6266 }
6263 6267
6264 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, 6268 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance,
6265 bool focused) { 6269 bool focused) {
6266 if (focused) 6270 if (focused)
6267 focused_pepper_plugin_ = instance; 6271 focused_pepper_plugin_ = instance;
6268 else if (focused_pepper_plugin_ == instance) 6272 else if (focused_pepper_plugin_ == instance)
6269 focused_pepper_plugin_ = nullptr; 6273 focused_pepper_plugin_ = nullptr;
6270 6274
6271 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, 6275 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME,
6272 ChangeSource::FROM_NON_IME); 6276 ChangeSource::FROM_NON_IME);
6273 GetRenderWidget()->UpdateSelectionBounds(); 6277 GetRenderWidget()->UpdateSelectionBounds();
6274 } 6278 }
6275 6279
6276 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { 6280 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) {
6277 // TODO(zqzhang): send PepperStartsPlayback message to the browser. 6281 RenderFrameImpl* const render_frame = instance->render_frame();
6278 // See https://crbug.com/619084 6282 if (render_frame) {
6283 render_frame->Send(
6284 new FrameHostMsg_PepperStartsPlayback(
6285 render_frame->GetRoutingID(),
6286 instance->pp_instance()));
6287 }
6279 } 6288 }
6280 6289
6281 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) { 6290 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) {
6282 // TODO(zqzhang): send PepperStopsPlayback message to the browser. 6291 RenderFrameImpl* const render_frame = instance->render_frame();
6283 // See https://crbug.com/619084 6292 if (render_frame) {
6293 render_frame->Send(
6294 new FrameHostMsg_PepperStopsPlayback(
6295 render_frame->GetRoutingID(),
6296 instance->pp_instance()));
6297 }
6284 } 6298 }
6285 6299
6286 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { 6300 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) {
6287 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( 6301 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>(
6288 PepperPluginInstance::Get(pp_instance)); 6302 PepperPluginInstance::Get(pp_instance));
6289 if (instance) 6303 if (instance)
6290 instance->audio_controller().SetVolume(volume); 6304 instance->audio_controller().SetVolume(volume);
6291 } 6305 }
6292 #endif // ENABLE_PLUGINS 6306 #endif // ENABLE_PLUGINS
6293 6307
(...skipping 12 matching lines...) Expand all
6306 // event target. Potentially a Pepper plugin will receive the event. 6320 // event target. Potentially a Pepper plugin will receive the event.
6307 // In order to tell whether a plugin gets the last mouse event and which it 6321 // In order to tell whether a plugin gets the last mouse event and which it
6308 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6322 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6309 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6323 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6310 // |pepper_last_mouse_event_target_|. 6324 // |pepper_last_mouse_event_target_|.
6311 pepper_last_mouse_event_target_ = nullptr; 6325 pepper_last_mouse_event_target_ = nullptr;
6312 #endif 6326 #endif
6313 } 6327 }
6314 6328
6315 } // namespace content 6329 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698