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

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: Rebase 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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 const MediaResponseCallback& callback) { 1772 const MediaResponseCallback& callback) {
1773 if (delegate_) { 1773 if (delegate_) {
1774 delegate_->RequestMediaAccessPermission(this, request, callback); 1774 delegate_->RequestMediaAccessPermission(this, request, callback);
1775 } else { 1775 } else {
1776 callback.Run(MediaStreamDevices(), 1776 callback.Run(MediaStreamDevices(),
1777 MEDIA_DEVICE_INVALID_STATE, 1777 MEDIA_DEVICE_INVALID_STATE,
1778 scoped_ptr<MediaStreamUI>()); 1778 scoped_ptr<MediaStreamUI>());
1779 } 1779 }
1780 } 1780 }
1781 1781
1782 bool WebContentsImpl::CheckMediaAccessPermission(const GURL& security_origin,
1783 MediaStreamType type) {
1784 DCHECK(type == MEDIA_DEVICE_AUDIO_CAPTURE ||
1785 type == MEDIA_DEVICE_VIDEO_CAPTURE);
1786 return delegate_ &&
1787 delegate_->CheckMediaAccessPermission(this, security_origin, type);
1788 }
1789
1782 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace( 1790 SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace(
1783 SiteInstance* instance) { 1791 SiteInstance* instance) {
1784 return controller_.GetSessionStorageNamespace(instance); 1792 return controller_.GetSessionStorageNamespace(instance);
1785 } 1793 }
1786 1794
1787 SessionStorageNamespaceMap WebContentsImpl::GetSessionStorageNamespaceMap() { 1795 SessionStorageNamespaceMap WebContentsImpl::GetSessionStorageNamespaceMap() {
1788 return controller_.GetSessionStorageNamespaceMap(); 1796 return controller_.GetSessionStorageNamespaceMap();
1789 } 1797 }
1790 1798
1791 FrameTree* WebContentsImpl::GetFrameTree() { 1799 FrameTree* WebContentsImpl::GetFrameTree() {
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after
4355 node->render_manager()->ResumeResponseDeferredAtStart(); 4363 node->render_manager()->ResumeResponseDeferredAtStart();
4356 } 4364 }
4357 4365
4358 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4366 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4359 force_disable_overscroll_content_ = force_disable; 4367 force_disable_overscroll_content_ = force_disable;
4360 if (view_) 4368 if (view_)
4361 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4369 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4362 } 4370 }
4363 4371
4364 } // namespace content 4372 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698