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

Side by Side Diff: chrome/browser/media/webrtc/media_permission.cc

Issue 2779463002: Chrome OS: Fix taking user pictures to be used as user POD images. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « chrome/browser/chromeos/login/ui/webui_login_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/webrtc/media_permission.h" 5 #include "chrome/browser/media/webrtc/media_permission.h"
6 6
7 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" 7 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
8 #include "chrome/browser/media/webrtc/media_stream_device_permissions.h" 8 #include "chrome/browser/media/webrtc/media_stream_device_permissions.h"
9 #include "chrome/browser/permissions/permission_context_base.h" 9 #include "chrome/browser/permissions/permission_context_base.h"
10 #include "chrome/browser/permissions/permission_manager.h" 10 #include "chrome/browser/permissions/permission_manager.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 chromeos::WebUILoginView* webui_login_view = 62 chromeos::WebUILoginView* webui_login_view =
63 login_display_host ? login_display_host->GetWebUILoginView() : nullptr; 63 login_display_host ? login_display_host->GetWebUILoginView() : nullptr;
64 content::WebContents* login_web_contents = 64 content::WebContents* login_web_contents =
65 webui_login_view ? webui_login_view->GetWebContents() : nullptr; 65 webui_login_view ? webui_login_view->GetWebContents() : nullptr;
66 if (web_contents_ == login_web_contents) { 66 if (web_contents_ == login_web_contents) {
67 if (content_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) { 67 if (content_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) {
68 *denial_reason = content::MEDIA_DEVICE_PERMISSION_DENIED; 68 *denial_reason = content::MEDIA_DEVICE_PERMISSION_DENIED;
69 return CONTENT_SETTING_BLOCK; 69 return CONTENT_SETTING_BLOCK;
70 } 70 }
71 71
72 // When creating new user (including supervised user), we must
73 // be able to use photo for user image.
74 constexpr char pattern[] = "chrome://oobe/";
Sergey Ulanov 2017/03/29 23:26:17 Use kChromeUIOobeURL from chrome/common/url_consta
Alexander Alekseev 2017/03/30 02:04:34 Done.
75 if (requesting_origin_.possibly_invalid_spec() == pattern) {
Sergey Ulanov 2017/03/29 23:26:17 use spec() instead of possibly_invalid_spec() here
Alexander Alekseev 2017/03/30 02:04:34 Done.
76 return CONTENT_SETTING_ALLOW;
77 }
78
72 const chromeos::CrosSettings* const settings = 79 const chromeos::CrosSettings* const settings =
73 chromeos::CrosSettings::Get(); 80 chromeos::CrosSettings::Get();
74 if (!settings) { 81 if (!settings) {
75 *denial_reason = content::MEDIA_DEVICE_PERMISSION_DENIED; 82 *denial_reason = content::MEDIA_DEVICE_PERMISSION_DENIED;
76 return CONTENT_SETTING_BLOCK; 83 return CONTENT_SETTING_BLOCK;
77 } 84 }
78 85
79 const base::Value* const raw_list_value = 86 const base::Value* const raw_list_value =
80 settings->GetPref(chromeos::kLoginVideoCaptureAllowedUrls); 87 settings->GetPref(chromeos::kLoginVideoCaptureAllowedUrls);
81 if (!raw_list_value) { 88 if (!raw_list_value) {
(...skipping 26 matching lines...) Expand all
108 // Check policy and content settings. 115 // Check policy and content settings.
109 ContentSetting content_setting = 116 ContentSetting content_setting =
110 permission_manager 117 permission_manager
111 ->GetPermissionStatus(content_type_, requesting_origin_, 118 ->GetPermissionStatus(content_type_, requesting_origin_,
112 embedding_origin_) 119 embedding_origin_)
113 .content_setting; 120 .content_setting;
114 if (content_setting == CONTENT_SETTING_BLOCK) 121 if (content_setting == CONTENT_SETTING_BLOCK)
115 *denial_reason = content::MEDIA_DEVICE_PERMISSION_DENIED; 122 *denial_reason = content::MEDIA_DEVICE_PERMISSION_DENIED;
116 return content_setting; 123 return content_setting;
117 } 124 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/webui_login_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698