| 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/permission_bubble_media_access_handler.h" | 5 #include "chrome/browser/media/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/media_permission.h" | 10 #include "chrome/browser/media/media_permission.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 PermissionUpdateInfoBarDelegate::Create( | 162 PermissionUpdateInfoBarDelegate::Create( |
| 163 web_contents, content_settings_types, | 163 web_contents, content_settings_types, |
| 164 base::Bind( | 164 base::Bind( |
| 165 &OnPermissionConflictResolved, base::Passed(&controller))); | 165 &OnPermissionConflictResolved, base::Passed(&controller))); |
| 166 } | 166 } |
| 167 #endif | 167 #endif |
| 168 return; | 168 return; |
| 169 } | 169 } |
| 170 | 170 |
| 171 #if BUILDFLAG(ANDROID_JAVA_UI) | 171 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 172 MediaStreamInfoBarDelegateAndroid::Create(web_contents, controller.Pass()); | 172 MediaStreamInfoBarDelegateAndroid::Create(web_contents, |
| 173 std::move(controller)); |
| 173 #else | 174 #else |
| 174 PermissionBubbleManager* bubble_manager = | 175 PermissionBubbleManager* bubble_manager = |
| 175 PermissionBubbleManager::FromWebContents(web_contents); | 176 PermissionBubbleManager::FromWebContents(web_contents); |
| 176 if (bubble_manager) | 177 if (bubble_manager) |
| 177 bubble_manager->AddRequest(controller.release()); | 178 bubble_manager->AddRequest(controller.release()); |
| 178 #endif | 179 #endif |
| 179 } | 180 } |
| 180 | 181 |
| 181 void PermissionBubbleMediaAccessHandler::UpdateMediaRequestState( | 182 void PermissionBubbleMediaAccessHandler::UpdateMediaRequestState( |
| 182 int render_process_id, | 183 int render_process_id, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 int type, | 246 int type, |
| 246 const content::NotificationSource& source, | 247 const content::NotificationSource& source, |
| 247 const content::NotificationDetails& details) { | 248 const content::NotificationDetails& details) { |
| 248 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 249 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 249 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 250 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 250 content::WebContents* web_contents = | 251 content::WebContents* web_contents = |
| 251 content::Source<content::WebContents>(source).ptr(); | 252 content::Source<content::WebContents>(source).ptr(); |
| 252 pending_requests_.erase(web_contents); | 253 pending_requests_.erase(web_contents); |
| 253 } | 254 } |
| 254 } | 255 } |
| OLD | NEW |