| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/media/public_session_tab_capture_access_handler.h" | 5 #include "chrome/browser/media/public_session_tab_capture_access_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "chrome/browser/chromeos/extensions/public_session_permission_helper.h" | 12 #include "chrome/browser/chromeos/extensions/public_session_permission_helper.h" |
| 13 #include "chrome/browser/profiles/profiles_state.h" | 13 #include "chrome/browser/profiles/profiles_state.h" |
| 14 #include "chromeos/login/login_state.h" | 14 #include "chromeos/login/login_state.h" |
| 15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 16 #include "extensions/common/extension.h" | 16 #include "extensions/common/extension.h" |
| 17 #include "extensions/common/permissions/manifest_permission_set.h" | 17 #include "extensions/common/permissions/manifest_permission_set.h" |
| 18 #include "extensions/common/permissions/permission_set.h" | 18 #include "extensions/common/permissions/permission_set.h" |
| 19 #include "extensions/common/url_pattern_set.h" | 19 #include "extensions/common/url_pattern_set.h" |
| 20 | 20 |
| 21 PublicSessionTabCaptureAccessHandler::PublicSessionTabCaptureAccessHandler() {} | 21 PublicSessionTabCaptureAccessHandler::PublicSessionTabCaptureAccessHandler() {} |
| 22 | 22 |
| 23 PublicSessionTabCaptureAccessHandler::~PublicSessionTabCaptureAccessHandler() {} | 23 PublicSessionTabCaptureAccessHandler::~PublicSessionTabCaptureAccessHandler() {} |
| 24 | 24 |
| 25 bool PublicSessionTabCaptureAccessHandler::SupportsStreamType( | 25 bool PublicSessionTabCaptureAccessHandler::SupportsStreamType( |
| 26 content::WebContents* web_contents, |
| 26 const content::MediaStreamType type, | 27 const content::MediaStreamType type, |
| 27 const extensions::Extension* extension) { | 28 const extensions::Extension* extension) { |
| 28 return tab_capture_access_handler_.SupportsStreamType(type, extension); | 29 return tab_capture_access_handler_.SupportsStreamType(web_contents, type, |
| 30 extension); |
| 29 } | 31 } |
| 30 | 32 |
| 31 bool PublicSessionTabCaptureAccessHandler::CheckMediaAccessPermission( | 33 bool PublicSessionTabCaptureAccessHandler::CheckMediaAccessPermission( |
| 32 content::WebContents* web_contents, | 34 content::WebContents* web_contents, |
| 33 const GURL& security_origin, | 35 const GURL& security_origin, |
| 34 content::MediaStreamType type, | 36 content::MediaStreamType type, |
| 35 const extensions::Extension* extension) { | 37 const extensions::Extension* extension) { |
| 36 return tab_capture_access_handler_.CheckMediaAccessPermission( | 38 return tab_capture_access_handler_.CheckMediaAccessPermission( |
| 37 web_contents, security_origin, type, extension); | 39 web_contents, security_origin, type, extension); |
| 38 } | 40 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // being passed on to the actual implementation. | 76 // being passed on to the actual implementation. |
| 75 if (!allowed_permissions.ContainsID(extensions::APIPermission::kTabCapture)) { | 77 if (!allowed_permissions.ContainsID(extensions::APIPermission::kTabCapture)) { |
| 76 request_copy.audio_type = content::MEDIA_NO_SERVICE; | 78 request_copy.audio_type = content::MEDIA_NO_SERVICE; |
| 77 request_copy.video_type = content::MEDIA_NO_SERVICE; | 79 request_copy.video_type = content::MEDIA_NO_SERVICE; |
| 78 } | 80 } |
| 79 | 81 |
| 80 // Pass the request through to the original class. | 82 // Pass the request through to the original class. |
| 81 tab_capture_access_handler_.HandleRequest(web_contents, request_copy, | 83 tab_capture_access_handler_.HandleRequest(web_contents, request_copy, |
| 82 callback, extension); | 84 callback, extension); |
| 83 } | 85 } |
| OLD | NEW |