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

Unified Diff: chrome/browser/permissions/permission_context_base.cc

Issue 2448893002: Check switch flag in CancelPermissionRequest (Closed)
Patch Set: nullptr Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_context_base.cc
diff --git a/chrome/browser/permissions/permission_context_base.cc b/chrome/browser/permissions/permission_context_base.cc
index c425ce9598150320374ee458cd91602f645f13d3..5c99fbd3668796176b5a1b073fa2f16d013f9c3b 100644
--- a/chrome/browser/permissions/permission_context_base.cc
+++ b/chrome/browser/permissions/permission_context_base.cc
@@ -153,16 +153,20 @@ void PermissionContextBase::CancelPermissionRequest(
const PermissionRequestID& id) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ if (PermissionRequestManager::IsEnabled()) {
+ PermissionRequest* cancelling = pending_requests_.get(id.ToString());
+ if (cancelling != nullptr && web_contents != nullptr &&
+ PermissionRequestManager::FromWebContents(web_contents) != nullptr) {
+ PermissionRequestManager::FromWebContents(web_contents)
+ ->CancelRequest(cancelling);
+ }
+ } else {
#if defined(OS_ANDROID)
- GetQueueController()->CancelInfoBarRequest(id);
+ GetQueueController()->CancelInfoBarRequest(id);
#else
- PermissionRequest* cancelling = pending_requests_.get(id.ToString());
- if (cancelling != NULL && web_contents != NULL &&
- PermissionRequestManager::FromWebContents(web_contents) != NULL) {
- PermissionRequestManager::FromWebContents(web_contents)
- ->CancelRequest(cancelling);
- }
+ NOTREACHED();
#endif
+ }
}
void PermissionContextBase::DecidePermission(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698