OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_quota_permission_context.h" | 5 #include "chrome/browser/chrome_quota_permission_context.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 // ChromeQuotaPermissionContext ----------------------------------------------- | 249 // ChromeQuotaPermissionContext ----------------------------------------------- |
250 | 250 |
251 ChromeQuotaPermissionContext::ChromeQuotaPermissionContext() { | 251 ChromeQuotaPermissionContext::ChromeQuotaPermissionContext() { |
252 } | 252 } |
253 | 253 |
254 void ChromeQuotaPermissionContext::RequestQuotaPermission( | 254 void ChromeQuotaPermissionContext::RequestQuotaPermission( |
255 const content::StorageQuotaParams& params, | 255 const content::StorageQuotaParams& params, |
256 int render_process_id, | 256 int render_process_id, |
257 const PermissionCallback& callback) { | 257 const PermissionCallback& callback) { |
258 if (params.storage_type != quota::kStorageTypePersistent) { | 258 if (params.storage_type != storage::kStorageTypePersistent) { |
259 // For now we only support requesting quota with this interface | 259 // For now we only support requesting quota with this interface |
260 // for Persistent storage type. | 260 // for Persistent storage type. |
261 callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); | 261 callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); |
262 return; | 262 return; |
263 } | 263 } |
264 | 264 |
265 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { | 265 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { |
266 content::BrowserThread::PostTask( | 266 content::BrowserThread::PostTask( |
267 content::BrowserThread::UI, FROM_HERE, | 267 content::BrowserThread::UI, FROM_HERE, |
268 base::Bind(&ChromeQuotaPermissionContext::RequestQuotaPermission, this, | 268 base::Bind(&ChromeQuotaPermissionContext::RequestQuotaPermission, this, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 content::BrowserThread::IO, FROM_HERE, | 320 content::BrowserThread::IO, FROM_HERE, |
321 base::Bind(&ChromeQuotaPermissionContext::DispatchCallbackOnIOThread, | 321 base::Bind(&ChromeQuotaPermissionContext::DispatchCallbackOnIOThread, |
322 this, callback, response)); | 322 this, callback, response)); |
323 return; | 323 return; |
324 } | 324 } |
325 | 325 |
326 callback.Run(response); | 326 callback.Run(response); |
327 } | 327 } |
328 | 328 |
329 ChromeQuotaPermissionContext::~ChromeQuotaPermissionContext() {} | 329 ChromeQuotaPermissionContext::~ChromeQuotaPermissionContext() {} |
OLD | NEW |