| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 callback.Run(devices, result, std::move(ui)); | 233 callback.Run(devices, result, std::move(ui)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void PermissionBubbleMediaAccessHandler::Observe( | 236 void PermissionBubbleMediaAccessHandler::Observe( |
| 237 int type, | 237 int type, |
| 238 const content::NotificationSource& source, | 238 const content::NotificationSource& source, |
| 239 const content::NotificationDetails& details) { | 239 const content::NotificationDetails& details) { |
| 240 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 240 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 241 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 241 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type); |
| 242 content::WebContents* web_contents = | 242 |
| 243 content::Source<content::WebContents>(source).ptr(); | 243 pending_requests_.erase(content::Source<content::WebContents>(source).ptr()); |
| 244 pending_requests_.erase(web_contents); | |
| 245 } | |
| 246 } | 244 } |
| OLD | NEW |