| OLD | NEW |
| 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/permission_bubble_media_access_handler.h" | 5 #include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "chrome/browser/media/webrtc/media_permission.h" | 10 #include "chrome/browser/media/webrtc/media_permission.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 PermissionUpdateInfoBarDelegate::Create( | 153 PermissionUpdateInfoBarDelegate::Create( |
| 154 web_contents, content_settings_types, | 154 web_contents, content_settings_types, |
| 155 base::Bind( | 155 base::Bind( |
| 156 &OnPermissionConflictResolved, base::Passed(&controller))); | 156 &OnPermissionConflictResolved, base::Passed(&controller))); |
| 157 } | 157 } |
| 158 #endif | 158 #endif |
| 159 return; | 159 return; |
| 160 } | 160 } |
| 161 | 161 |
| 162 #if BUILDFLAG(ANDROID_JAVA_UI) | 162 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 163 MediaStreamInfoBarDelegateAndroid::Create(web_contents, | 163 Profile* profile = |
| 164 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 165 MediaStreamInfoBarDelegateAndroid::Create(profile, web_contents, |
| 164 std::move(controller)); | 166 std::move(controller)); |
| 165 #else | 167 #else |
| 166 PermissionRequestManager* permission_request_manager = | 168 PermissionRequestManager* permission_request_manager = |
| 167 PermissionRequestManager::FromWebContents(web_contents); | 169 PermissionRequestManager::FromWebContents(web_contents); |
| 168 if (permission_request_manager) | 170 if (permission_request_manager) |
| 169 permission_request_manager->AddRequest(controller.release()); | 171 permission_request_manager->AddRequest(controller.release()); |
| 170 #endif | 172 #endif |
| 171 } | 173 } |
| 172 | 174 |
| 173 void PermissionBubbleMediaAccessHandler::UpdateMediaRequestState( | 175 void PermissionBubbleMediaAccessHandler::UpdateMediaRequestState( |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 237 |
| 236 void PermissionBubbleMediaAccessHandler::Observe( | 238 void PermissionBubbleMediaAccessHandler::Observe( |
| 237 int type, | 239 int type, |
| 238 const content::NotificationSource& source, | 240 const content::NotificationSource& source, |
| 239 const content::NotificationDetails& details) { | 241 const content::NotificationDetails& details) { |
| 240 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 242 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 241 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type); | 243 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type); |
| 242 | 244 |
| 243 pending_requests_.erase(content::Source<content::WebContents>(source).ptr()); | 245 pending_requests_.erase(content::Source<content::WebContents>(source).ptr()); |
| 244 } | 246 } |
| OLD | NEW |