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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1698933004: Make MediaSession a runtime-enabled feature on Desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove windows specific stuff Created 4 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "content/browser/frame_host/navigator_impl.h" 46 #include "content/browser/frame_host/navigator_impl.h"
47 #include "content/browser/frame_host/render_frame_host_impl.h" 47 #include "content/browser/frame_host/render_frame_host_impl.h"
48 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 48 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
49 #include "content/browser/geolocation/geolocation_service_context.h" 49 #include "content/browser/geolocation/geolocation_service_context.h"
50 #include "content/browser/host_zoom_map_impl.h" 50 #include "content/browser/host_zoom_map_impl.h"
51 #include "content/browser/loader/resource_dispatcher_host_impl.h" 51 #include "content/browser/loader/resource_dispatcher_host_impl.h"
52 #include "content/browser/manifest/manifest_manager_host.h" 52 #include "content/browser/manifest/manifest_manager_host.h"
53 #include "content/browser/media/audio_stream_monitor.h" 53 #include "content/browser/media/audio_stream_monitor.h"
54 #include "content/browser/media/capture/web_contents_audio_muter.h" 54 #include "content/browser/media/capture/web_contents_audio_muter.h"
55 #include "content/browser/media/media_web_contents_observer.h" 55 #include "content/browser/media/media_web_contents_observer.h"
56 #include "content/browser/media/session/media_session.h"
56 #include "content/browser/message_port_message_filter.h" 57 #include "content/browser/message_port_message_filter.h"
57 #include "content/browser/plugin_content_origin_whitelist.h" 58 #include "content/browser/plugin_content_origin_whitelist.h"
58 #include "content/browser/renderer_host/render_process_host_impl.h" 59 #include "content/browser/renderer_host/render_process_host_impl.h"
59 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 60 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
60 #include "content/browser/renderer_host/render_view_host_impl.h" 61 #include "content/browser/renderer_host/render_view_host_impl.h"
61 #include "content/browser/renderer_host/render_widget_host_impl.h" 62 #include "content/browser/renderer_host/render_widget_host_impl.h"
62 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 63 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
63 #include "content/browser/renderer_host/render_widget_host_view_base.h" 64 #include "content/browser/renderer_host/render_widget_host_view_base.h"
64 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h" 65 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h"
65 #include "content/browser/site_instance_impl.h" 66 #include "content/browser/site_instance_impl.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 #include "third_party/WebKit/public/web/WebSandboxFlags.h" 118 #include "third_party/WebKit/public/web/WebSandboxFlags.h"
118 #include "third_party/skia/include/core/SkBitmap.h" 119 #include "third_party/skia/include/core/SkBitmap.h"
119 #include "ui/base/layout.h" 120 #include "ui/base/layout.h"
120 #include "ui/gfx/display.h" 121 #include "ui/gfx/display.h"
121 #include "ui/gfx/screen.h" 122 #include "ui/gfx/screen.h"
122 #include "ui/gl/gl_switches.h" 123 #include "ui/gl/gl_switches.h"
123 124
124 #if defined(OS_ANDROID) 125 #if defined(OS_ANDROID)
125 #include "content/browser/android/content_video_view.h" 126 #include "content/browser/android/content_video_view.h"
126 #include "content/browser/android/date_time_chooser_android.h" 127 #include "content/browser/android/date_time_chooser_android.h"
127 #include "content/browser/media/android/media_session.h"
128 #include "content/browser/media/android/media_web_contents_observer_android.h" 128 #include "content/browser/media/android/media_web_contents_observer_android.h"
129 #include "content/browser/web_contents/web_contents_android.h" 129 #include "content/browser/web_contents/web_contents_android.h"
130 #endif // OS_ANDROID 130 #endif // OS_ANDROID
131 131
132 #if defined(OS_MACOSX) 132 #if defined(OS_MACOSX)
133 #include "base/mac/foundation_util.h" 133 #include "base/mac/foundation_util.h"
134 #endif 134 #endif
135 135
136 #if defined(MOJO_SHELL_CLIENT) 136 #if defined(MOJO_SHELL_CLIENT)
137 #include "content/browser/web_contents/web_contents_view_mus.h" 137 #include "content/browser/web_contents/web_contents_view_mus.h"
(...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3533 // for the new page has committed. 3533 // for the new page has committed.
3534 RenderViewHostImpl* rvhi = 3534 RenderViewHostImpl* rvhi =
3535 static_cast<RenderViewHostImpl*>(render_view_message_source_); 3535 static_cast<RenderViewHostImpl*>(render_view_message_source_);
3536 if (!rvhi->is_active()) 3536 if (!rvhi->is_active())
3537 return; 3537 return;
3538 3538
3539 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3539 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3540 DidUpdateFaviconURL(candidates)); 3540 DidUpdateFaviconURL(candidates));
3541 } 3541 }
3542 3542
3543 #if defined(OS_ANDROID)
3544
3545 void WebContentsImpl::OnMediaSessionStateChanged() { 3543 void WebContentsImpl::OnMediaSessionStateChanged() {
3546 MediaSession* session = MediaSession::Get(this); 3544 MediaSession* session = MediaSession::Get(this);
3547 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3545 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3548 MediaSessionStateChanged(session->IsControllable(), 3546 MediaSessionStateChanged(session->IsControllable(),
3549 session->IsSuspended())); 3547 session->IsSuspended()));
3550 } 3548 }
3551 3549
3552 void WebContentsImpl::ResumeMediaSession() { 3550 void WebContentsImpl::ResumeMediaSession() {
3553 MediaSession::Get(this)->Resume(); 3551 MediaSession::Get(this)->Resume(MediaSession::SuspendType::UI);
3554 } 3552 }
3555 3553
3556 void WebContentsImpl::SuspendMediaSession() { 3554 void WebContentsImpl::SuspendMediaSession() {
3557 MediaSession::Get(this)->Suspend(); 3555 MediaSession::Get(this)->Suspend(MediaSession::SuspendType::UI);
3558 } 3556 }
3559 3557
3560 void WebContentsImpl::StopMediaSession() { 3558 void WebContentsImpl::StopMediaSession() {
3561 MediaSession::Get(this)->Stop(); 3559 MediaSession::Get(this)->Stop(MediaSession::SuspendType::UI);
3562 } 3560 }
3563 3561
3564 #endif // defined(OS_ANDROID)
3565
3566 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { 3562 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() {
3567 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3563 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3568 DidFirstVisuallyNonEmptyPaint()); 3564 DidFirstVisuallyNonEmptyPaint());
3569 3565
3570 did_first_visually_non_empty_paint_ = true; 3566 did_first_visually_non_empty_paint_ = true;
3571 3567
3572 if (theme_color_ != last_sent_theme_color_) { 3568 if (theme_color_ != last_sent_theme_color_) {
3573 // Theme color should have updated by now if there was one. 3569 // Theme color should have updated by now if there was one.
3574 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3570 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3575 DidChangeThemeColor(theme_color_)); 3571 DidChangeThemeColor(theme_color_));
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4787 const WebContentsObserver::MediaPlayerId& id) { 4783 const WebContentsObserver::MediaPlayerId& id) {
4788 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); 4784 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id));
4789 } 4785 }
4790 4786
4791 void WebContentsImpl::MediaStoppedPlaying( 4787 void WebContentsImpl::MediaStoppedPlaying(
4792 const WebContentsObserver::MediaPlayerId& id) { 4788 const WebContentsObserver::MediaPlayerId& id) {
4793 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); 4789 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id));
4794 } 4790 }
4795 4791
4796 } // namespace content 4792 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698