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

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

Issue 2448893002: Check switch flag in CancelPermissionRequest (Closed)
Patch Set: 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 54cef05c281fba2be6b03258f375a1ad1f704f7b..d4d8b9706d3dd98f03615444b981a28e1bbb6ca3 100644
--- a/chrome/browser/permissions/permission_context_base.cc
+++ b/chrome/browser/permissions/permission_context_base.cc
@@ -152,16 +152,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 != NULL && web_contents != NULL &&
raymes 2016/10/27 04:35:52 nit: nullptr
lshang 2016/10/27 06:45:20 Done.
+ PermissionRequestManager::FromWebContents(web_contents) != NULL) {
+ 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