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

Unified Diff: chrome/browser/chrome_quota_permission_context.cc

Issue 341833004: [WebsiteSettings] Enable permission bubbles by default. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 | chrome/browser/content_settings/permission_context_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_quota_permission_context.cc
diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc
index 2dbe9307a57429cf5fb9e8e401a3d2157d590d22..e6d1a1a27621a6d04c694324161ef21d543407fa 100644
--- a/chrome/browser/chrome_quota_permission_context.cc
+++ b/chrome/browser/chrome_quota_permission_context.cc
@@ -281,6 +281,17 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
return;
}
+ // TODO(gbillock): adapt this to be a better indicator of background page tab.
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ if (!infobar_service) {
+ // The tab has no infobar service.
+ LOG(WARNING) << "Attempt to request quota from a background page: "
+ << render_process_id << "," << params.render_view_id;
+ DispatchCallbackOnIOThread(callback, QUOTA_PERMISSION_RESPONSE_CANCELLED);
+ return;
+ }
+
if (PermissionBubbleManager::Enabled()) {
PermissionBubbleManager* bubble_manager =
PermissionBubbleManager::FromWebContents(web_contents);
@@ -294,15 +305,6 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
return;
}
- InfoBarService* infobar_service =
- InfoBarService::FromWebContents(web_contents);
- if (!infobar_service) {
- // The tab has no infobar service.
- LOG(WARNING) << "Attempt to request quota from a background page: "
- << render_process_id << "," << params.render_view_id;
- DispatchCallbackOnIOThread(callback, QUOTA_PERMISSION_RESPONSE_CANCELLED);
- return;
- }
RequestQuotaInfoBarDelegate::Create(
infobar_service, this, params.origin_url, params.requested_size,
Profile::FromBrowserContext(web_contents->GetBrowserContext())->
« no previous file with comments | « no previous file | chrome/browser/content_settings/permission_context_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698