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

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

Issue 2065513004: Expose flash playback status and volume control to content renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_focus_manager
Patch Set: addressing nits Created 4 years, 6 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 #include "content/renderer/media/midi_dispatcher.h" 108 #include "content/renderer/media/midi_dispatcher.h"
109 #include "content/renderer/media/render_media_log.h" 109 #include "content/renderer/media/render_media_log.h"
110 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" 110 #include "content/renderer/media/renderer_webmediaplayer_delegate.h"
111 #include "content/renderer/media/user_media_client_impl.h" 111 #include "content/renderer/media/user_media_client_impl.h"
112 #include "content/renderer/media/web_media_element_source_utils.h" 112 #include "content/renderer/media/web_media_element_source_utils.h"
113 #include "content/renderer/media/webmediaplayer_ms.h" 113 #include "content/renderer/media/webmediaplayer_ms.h"
114 #include "content/renderer/mojo/service_registry_js_wrapper.h" 114 #include "content/renderer/mojo/service_registry_js_wrapper.h"
115 #include "content/renderer/mojo_bindings_controller.h" 115 #include "content/renderer/mojo_bindings_controller.h"
116 #include "content/renderer/navigation_state_impl.h" 116 #include "content/renderer/navigation_state_impl.h"
117 #include "content/renderer/notification_permission_dispatcher.h" 117 #include "content/renderer/notification_permission_dispatcher.h"
118 #include "content/renderer/pepper/pepper_audio_controller.h"
118 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" 119 #include "content/renderer/pepper/plugin_instance_throttler_impl.h"
119 #include "content/renderer/presentation/presentation_dispatcher.h" 120 #include "content/renderer/presentation/presentation_dispatcher.h"
120 #include "content/renderer/push_messaging/push_messaging_dispatcher.h" 121 #include "content/renderer/push_messaging/push_messaging_dispatcher.h"
121 #include "content/renderer/render_frame_proxy.h" 122 #include "content/renderer/render_frame_proxy.h"
122 #include "content/renderer/render_process.h" 123 #include "content/renderer/render_process.h"
123 #include "content/renderer/render_thread_impl.h" 124 #include "content/renderer/render_thread_impl.h"
124 #include "content/renderer/render_view_impl.h" 125 #include "content/renderer/render_view_impl.h"
125 #include "content/renderer/render_widget_fullscreen_pepper.h" 126 #include "content/renderer/render_widget_fullscreen_pepper.h"
126 #include "content/renderer/renderer_webapplicationcachehost_impl.h" 127 #include "content/renderer/renderer_webapplicationcachehost_impl.h"
127 #include "content/renderer/renderer_webcolorchooser_impl.h" 128 #include "content/renderer/renderer_webcolorchooser_impl.h"
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 bool handled = true; 1477 bool handled = true;
1477 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) 1478 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg)
1478 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1479 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1479 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) 1480 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload)
1480 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) 1481 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut)
1481 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame) 1482 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame)
1482 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop) 1483 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop)
1483 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) 1484 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed)
1484 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, 1485 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction,
1485 OnCustomContextMenuAction) 1486 OnCustomContextMenuAction)
1487 #if defined(ENABLE_PLUGINS)
1488 IPC_MESSAGE_HANDLER(FrameMsg_SetPepperVolume, OnSetPepperVolume)
1489 #endif //defined(ENABLE_PLUGINS)
1486 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo) 1490 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo)
1487 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo) 1491 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo)
1488 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut) 1492 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut)
1489 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy) 1493 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy)
1490 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste) 1494 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste)
1491 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 1495 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
1492 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete) 1496 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete)
1493 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll) 1497 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll)
1494 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange) 1498 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange)
1495 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset, 1499 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset,
(...skipping 4735 matching lines...) Expand 10 before | Expand all | Expand 10 after
6231 if (focused) 6235 if (focused)
6232 focused_pepper_plugin_ = instance; 6236 focused_pepper_plugin_ = instance;
6233 else if (focused_pepper_plugin_ == instance) 6237 else if (focused_pepper_plugin_ == instance)
6234 focused_pepper_plugin_ = nullptr; 6238 focused_pepper_plugin_ = nullptr;
6235 6239
6236 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, 6240 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME,
6237 ChangeSource::FROM_NON_IME); 6241 ChangeSource::FROM_NON_IME);
6238 GetRenderWidget()->UpdateSelectionBounds(); 6242 GetRenderWidget()->UpdateSelectionBounds();
6239 } 6243 }
6240 6244
6245 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) {
6246 // TODO(zqzhang): send PepperStartsPlayback message to the browser.
no sievers 2016/06/23 17:25:58 nit: bug numbers are a better reference than user
Zhiqiang Zhang (Slow) 2016/06/23 18:30:25 Done.
6247 }
6248
6249 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) {
6250 // TODO(zqzhang): send PepperStopsPlayback message to the browser.
6251 }
6252
6253 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) {
6254 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>(
6255 PepperPluginInstance::Get(pp_instance));
6256 if (instance)
6257 instance->audio_controller().SetVolume(volume);
6258 }
6241 #endif // ENABLE_PLUGINS 6259 #endif // ENABLE_PLUGINS
6242 6260
6243 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) { 6261 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) {
6244 #if defined(ENABLE_PLUGINS) 6262 #if defined(ENABLE_PLUGINS)
6245 // Notify all Pepper plugins. 6263 // Notify all Pepper plugins.
6246 for (auto* plugin : active_pepper_instances_) 6264 for (auto* plugin : active_pepper_instances_)
6247 plugin->SetContentAreaFocus(enable); 6265 plugin->SetContentAreaFocus(enable);
6248 #endif 6266 #endif
6249 } 6267 }
6250 6268
6251 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() { 6269 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() {
6252 #if defined(ENABLE_PLUGINS) 6270 #if defined(ENABLE_PLUGINS)
6253 // This method is called for every mouse event that the RenderWidget receives. 6271 // This method is called for every mouse event that the RenderWidget receives.
6254 // And then the mouse event is forwarded to blink, which dispatches it to the 6272 // And then the mouse event is forwarded to blink, which dispatches it to the
6255 // event target. Potentially a Pepper plugin will receive the event. 6273 // event target. Potentially a Pepper plugin will receive the event.
6256 // In order to tell whether a plugin gets the last mouse event and which it 6274 // In order to tell whether a plugin gets the last mouse event and which it
6257 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6275 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6258 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6276 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6259 // |pepper_last_mouse_event_target_|. 6277 // |pepper_last_mouse_event_target_|.
6260 pepper_last_mouse_event_target_ = nullptr; 6278 pepper_last_mouse_event_target_ = nullptr;
6261 #endif 6279 #endif
6262 } 6280 }
6263 6281
6264 } // namespace content 6282 } // namespace content
OLDNEW
« content/renderer/pepper/pepper_audio_controller.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698