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

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

Issue 562263002: Check media permissions through RenderFrameHostDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render_frame_get_sources
Patch Set: Updated unit test MediaStreamDispatcherHost. Created 6 years, 3 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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 const MediaResponseCallback& callback) { 1765 const MediaResponseCallback& callback) {
1766 if (delegate_) { 1766 if (delegate_) {
1767 delegate_->RequestMediaAccessPermission(this, request, callback); 1767 delegate_->RequestMediaAccessPermission(this, request, callback);
1768 } else { 1768 } else {
1769 callback.Run(MediaStreamDevices(), 1769 callback.Run(MediaStreamDevices(),
1770 MEDIA_DEVICE_INVALID_STATE, 1770 MEDIA_DEVICE_INVALID_STATE,
1771 scoped_ptr<MediaStreamUI>()); 1771 scoped_ptr<MediaStreamUI>());
1772 } 1772 }
1773 } 1773 }
1774 1774
1775 bool WebContentsImpl::CheckMediaAccessPermission(const GURL& security_origin,
1776 MediaStreamType type) {
1777 DCHECK(type == MEDIA_DEVICE_AUDIO_CAPTURE ||
1778 type == MEDIA_DEVICE_VIDEO_CAPTURE);
1779 return delegate_ &&
1780 delegate_->CheckMediaAccessPermission(this, security_origin, type);
1781 }
1782
1775 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace( 1783 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace(
1776 SiteInstance* instance) { 1784 SiteInstance* instance) {
1777 return controller_.GetSessionStorageNamespace(instance); 1785 return controller_.GetSessionStorageNamespace(instance);
1778 } 1786 }
1779 1787
1780 SessionStorageNamespaceMap WebContentsImpl::GetSessionStorageNamespaceMap() { 1788 SessionStorageNamespaceMap WebContentsImpl::GetSessionStorageNamespaceMap() {
1781 return controller_.GetSessionStorageNamespaceMap(); 1789 return controller_.GetSessionStorageNamespaceMap();
1782 } 1790 }
1783 1791
1784 FrameTree* WebContentsImpl::GetFrameTree() { 1792 FrameTree* WebContentsImpl::GetFrameTree() {
(...skipping 2548 matching lines...) Expand 10 before | Expand all | Expand 10 after
4333 node->render_manager()->ResumeResponseDeferredAtStart(); 4341 node->render_manager()->ResumeResponseDeferredAtStart();
4334 } 4342 }
4335 4343
4336 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4344 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4337 force_disable_overscroll_content_ = force_disable; 4345 force_disable_overscroll_content_ = force_disable;
4338 if (view_) 4346 if (view_)
4339 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4347 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4340 } 4348 }
4341 4349
4342 } // namespace content 4350 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698