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

Unified Diff: chrome/browser/chrome_quota_permission_context.cc

Issue 185793004: [Quota] Pass user gesture state with quota request message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 3 try Created 6 years, 10 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
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 fc03747607115e30039b97e0df95e51b550c452a..2ca726fb32e2c8753acd0941fc01476e3eebe1df 100644
--- a/chrome/browser/chrome_quota_permission_context.cc
+++ b/chrome/browser/chrome_quota_permission_context.cc
@@ -240,13 +240,10 @@ ChromeQuotaPermissionContext::ChromeQuotaPermissionContext() {
}
void ChromeQuotaPermissionContext::RequestQuotaPermission(
- const GURL& origin_url,
- quota::StorageType type,
- int64 requested_quota,
+ const quota::RequestStorageQuotaParams& params,
int render_process_id,
- int render_view_id,
const PermissionCallback& callback) {
- if (type != quota::kStorageTypePersistent) {
+ if (params.storage_type != quota::kStorageTypePersistent) {
// For now we only support requesting quota with this interface
// for Persistent storage type.
callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
@@ -257,17 +254,17 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&ChromeQuotaPermissionContext::RequestQuotaPermission, this,
- origin_url, type, requested_quota, render_process_id,
- render_view_id, callback));
+ params, render_process_id, callback));
return;
}
content::WebContents* web_contents =
- tab_util::GetWebContentsByID(render_process_id, render_view_id);
+ tab_util::GetWebContentsByID(render_process_id,
+ params.render_view_id);
if (!web_contents) {
// The tab may have gone away or the request may not be from a tab.
LOG(WARNING) << "Attempt to request quota tabless renderer: "
- << render_process_id << "," << render_view_id;
+ << render_process_id << "," << params.render_view_id;
DispatchCallbackOnIOThread(callback, QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
}
@@ -276,7 +273,7 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
PermissionBubbleManager* bubble_manager =
PermissionBubbleManager::FromWebContents(web_contents);
bubble_manager->AddRequest(new QuotaPermissionRequest(this,
- origin_url, requested_quota,
+ params.origin_url, params.requested_size,
Profile::FromBrowserContext(web_contents->GetBrowserContext())->
GetPrefs()->GetString(prefs::kAcceptLanguages),
callback));
@@ -288,12 +285,12 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
if (!infobar_service) {
// The tab has no infobar service.
LOG(WARNING) << "Attempt to request quota from a background page: "
- << render_process_id << "," << render_view_id;
+ << render_process_id << "," << params.render_view_id;
DispatchCallbackOnIOThread(callback, QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
}
RequestQuotaInfoBarDelegate::Create(
- infobar_service, this, origin_url, requested_quota,
+ infobar_service, this, params.origin_url, params.requested_size,
Profile::FromBrowserContext(web_contents->GetBrowserContext())->
GetPrefs()->GetString(prefs::kAcceptLanguages),
callback);

Powered by Google App Engine
This is Rietveld 408576698