| 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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 bool RequestQuotaInfoBarDelegate::Cancel() { | 103 bool RequestQuotaInfoBarDelegate::Cancel() { |
| 104 context_->DispatchCallbackOnIOThread( | 104 context_->DispatchCallbackOnIOThread( |
| 105 callback_, | 105 callback_, |
| 106 QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_CANCELLED); | 106 QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_CANCELLED); |
| 107 return true; | 107 return true; |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // anonymous namespace | 110 } // anonymous namespace |
| 111 | 111 |
| 112 ChromeQuotaPermissionContext::ChromeQuotaPermissionContext() { | 112 ChromeQuotaPermissionContext::ChromeQuotaPermissionContext() {} |
| 113 } | |
| 114 | |
| 115 ChromeQuotaPermissionContext::~ChromeQuotaPermissionContext() { | |
| 116 } | |
| 117 | 113 |
| 118 void ChromeQuotaPermissionContext::RequestQuotaPermission( | 114 void ChromeQuotaPermissionContext::RequestQuotaPermission( |
| 119 const GURL& origin_url, | 115 const GURL& origin_url, |
| 120 quota::StorageType type, | 116 quota::StorageType type, |
| 121 int64 requested_quota, | 117 int64 requested_quota, |
| 122 int render_process_id, | 118 int render_process_id, |
| 123 int render_view_id, | 119 int render_view_id, |
| 124 const PermissionCallback& callback) { | 120 const PermissionCallback& callback) { |
| 125 if (type != quota::kStorageTypePersistent) { | 121 if (type != quota::kStorageTypePersistent) { |
| 126 // For now we only support requesting quota with this interface | 122 // For now we only support requesting quota with this interface |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 161 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 166 BrowserThread::PostTask( | 162 BrowserThread::PostTask( |
| 167 BrowserThread::IO, FROM_HERE, | 163 BrowserThread::IO, FROM_HERE, |
| 168 base::Bind(&ChromeQuotaPermissionContext::DispatchCallbackOnIOThread, | 164 base::Bind(&ChromeQuotaPermissionContext::DispatchCallbackOnIOThread, |
| 169 this, callback, response)); | 165 this, callback, response)); |
| 170 return; | 166 return; |
| 171 } | 167 } |
| 172 | 168 |
| 173 callback.Run(response); | 169 callback.Run(response); |
| 174 } | 170 } |
| 171 |
| 172 ChromeQuotaPermissionContext::~ChromeQuotaPermissionContext() {} |
| OLD | NEW |