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

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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #include "content/renderer/media/midi_dispatcher.h" 110 #include "content/renderer/media/midi_dispatcher.h"
111 #include "content/renderer/media/render_media_log.h" 111 #include "content/renderer/media/render_media_log.h"
112 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" 112 #include "content/renderer/media/renderer_webmediaplayer_delegate.h"
113 #include "content/renderer/media/user_media_client_impl.h" 113 #include "content/renderer/media/user_media_client_impl.h"
114 #include "content/renderer/media/web_media_element_source_utils.h" 114 #include "content/renderer/media/web_media_element_source_utils.h"
115 #include "content/renderer/media/webmediaplayer_ms.h" 115 #include "content/renderer/media/webmediaplayer_ms.h"
116 #include "content/renderer/mojo/interface_provider_js_wrapper.h" 116 #include "content/renderer/mojo/interface_provider_js_wrapper.h"
117 #include "content/renderer/mojo_bindings_controller.h" 117 #include "content/renderer/mojo_bindings_controller.h"
118 #include "content/renderer/navigation_state_impl.h" 118 #include "content/renderer/navigation_state_impl.h"
119 #include "content/renderer/notification_permission_dispatcher.h" 119 #include "content/renderer/notification_permission_dispatcher.h"
120 #include "content/renderer/pepper/pepper_audio_controller.h"
120 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" 121 #include "content/renderer/pepper/plugin_instance_throttler_impl.h"
121 #include "content/renderer/presentation/presentation_dispatcher.h" 122 #include "content/renderer/presentation/presentation_dispatcher.h"
122 #include "content/renderer/push_messaging/push_messaging_dispatcher.h" 123 #include "content/renderer/push_messaging/push_messaging_dispatcher.h"
123 #include "content/renderer/render_frame_proxy.h" 124 #include "content/renderer/render_frame_proxy.h"
124 #include "content/renderer/render_process.h" 125 #include "content/renderer/render_process.h"
125 #include "content/renderer/render_thread_impl.h" 126 #include "content/renderer/render_thread_impl.h"
126 #include "content/renderer/render_view_impl.h" 127 #include "content/renderer/render_view_impl.h"
127 #include "content/renderer/render_widget_fullscreen_pepper.h" 128 #include "content/renderer/render_widget_fullscreen_pepper.h"
128 #include "content/renderer/renderer_webapplicationcachehost_impl.h" 129 #include "content/renderer/renderer_webapplicationcachehost_impl.h"
129 #include "content/renderer/renderer_webcolorchooser_impl.h" 130 #include "content/renderer/renderer_webcolorchooser_impl.h"
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 bool handled = true; 1486 bool handled = true;
1486 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) 1487 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg)
1487 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) 1488 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate)
1488 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) 1489 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload)
1489 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) 1490 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut)
1490 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame) 1491 IPC_MESSAGE_HANDLER(FrameMsg_Delete, OnDeleteFrame)
1491 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop) 1492 IPC_MESSAGE_HANDLER(FrameMsg_Stop, OnStop)
1492 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) 1493 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed)
1493 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, 1494 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction,
1494 OnCustomContextMenuAction) 1495 OnCustomContextMenuAction)
1496 #if defined(ENABLE_PLUGINS)
1497 IPC_MESSAGE_HANDLER(FrameMsg_SetPepperVolume, OnSetPepperVolume)
1498 #endif //defined(ENABLE_PLUGINS)
1495 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo) 1499 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo)
1496 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo) 1500 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo)
1497 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut) 1501 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut)
1498 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy) 1502 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy)
1499 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste) 1503 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste)
1500 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 1504 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
1501 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete) 1505 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete)
1502 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll) 1506 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll)
1503 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange) 1507 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange)
1504 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset, 1508 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset,
(...skipping 4757 matching lines...) Expand 10 before | Expand all | Expand 10 after
6262 if (focused) 6266 if (focused)
6263 focused_pepper_plugin_ = instance; 6267 focused_pepper_plugin_ = instance;
6264 else if (focused_pepper_plugin_ == instance) 6268 else if (focused_pepper_plugin_ == instance)
6265 focused_pepper_plugin_ = nullptr; 6269 focused_pepper_plugin_ = nullptr;
6266 6270
6267 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, 6271 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME,
6268 ChangeSource::FROM_NON_IME); 6272 ChangeSource::FROM_NON_IME);
6269 GetRenderWidget()->UpdateSelectionBounds(); 6273 GetRenderWidget()->UpdateSelectionBounds();
6270 } 6274 }
6271 6275
6276 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) {
6277 // TODO(zqzhang): send PepperStartsPlayback message to the browser.
6278 // See https://crbug.com/619084
6279 }
6280
6281 void RenderFrameImpl::PepperStopsPlayback(PepperPluginInstanceImpl* instance) {
6282 // TODO(zqzhang): send PepperStopsPlayback message to the browser.
6283 // See https://crbug.com/619084
6284 }
6285
6286 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) {
6287 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>(
6288 PepperPluginInstance::Get(pp_instance));
6289 if (instance)
6290 instance->audio_controller().SetVolume(volume);
6291 }
6272 #endif // ENABLE_PLUGINS 6292 #endif // ENABLE_PLUGINS
6273 6293
6274 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) { 6294 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) {
6275 #if defined(ENABLE_PLUGINS) 6295 #if defined(ENABLE_PLUGINS)
6276 // Notify all Pepper plugins. 6296 // Notify all Pepper plugins.
6277 for (auto* plugin : active_pepper_instances_) 6297 for (auto* plugin : active_pepper_instances_)
6278 plugin->SetContentAreaFocus(enable); 6298 plugin->SetContentAreaFocus(enable);
6279 #endif 6299 #endif
6280 } 6300 }
6281 6301
6282 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() { 6302 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() {
6283 #if defined(ENABLE_PLUGINS) 6303 #if defined(ENABLE_PLUGINS)
6284 // This method is called for every mouse event that the RenderWidget receives. 6304 // This method is called for every mouse event that the RenderWidget receives.
6285 // And then the mouse event is forwarded to blink, which dispatches it to the 6305 // And then the mouse event is forwarded to blink, which dispatches it to the
6286 // event target. Potentially a Pepper plugin will receive the event. 6306 // event target. Potentially a Pepper plugin will receive the event.
6287 // In order to tell whether a plugin gets the last mouse event and which it 6307 // In order to tell whether a plugin gets the last mouse event and which it
6288 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6308 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6289 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6309 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6290 // |pepper_last_mouse_event_target_|. 6310 // |pepper_last_mouse_event_target_|.
6291 pepper_last_mouse_event_target_ = nullptr; 6311 pepper_last_mouse_event_target_ = nullptr;
6292 #endif 6312 #endif
6293 } 6313 }
6294 6314
6295 } // namespace content 6315 } // namespace content
OLDNEW
« content/renderer/pepper/pepper_audio_controller.cc ('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