| 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 #ifndef CONTENT_PUBLIC_BROWSER_QUOTA_PERMISSION_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_QUOTA_PERMISSION_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_QUOTA_PERMISSION_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_QUOTA_PERMISSION_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/public/common/storage_quota_params.h" |
| 10 #include "webkit/common/quota/quota_types.h" | 11 #include "webkit/common/quota/quota_types.h" |
| 11 | 12 |
| 12 class GURL; | 13 class GURL; |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 class QuotaPermissionContext | 17 class QuotaPermissionContext |
| 17 : public base::RefCountedThreadSafe<QuotaPermissionContext> { | 18 : public base::RefCountedThreadSafe<QuotaPermissionContext> { |
| 18 public: | 19 public: |
| 19 enum QuotaPermissionResponse { | 20 enum QuotaPermissionResponse { |
| 20 QUOTA_PERMISSION_RESPONSE_UNKNOWN, | 21 QUOTA_PERMISSION_RESPONSE_UNKNOWN, |
| 21 QUOTA_PERMISSION_RESPONSE_ALLOW, | 22 QUOTA_PERMISSION_RESPONSE_ALLOW, |
| 22 QUOTA_PERMISSION_RESPONSE_DISALLOW, | 23 QUOTA_PERMISSION_RESPONSE_DISALLOW, |
| 23 QUOTA_PERMISSION_RESPONSE_CANCELLED, | 24 QUOTA_PERMISSION_RESPONSE_CANCELLED, |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 typedef base::Callback<void(QuotaPermissionResponse)> PermissionCallback; | 27 typedef base::Callback<void(QuotaPermissionResponse)> PermissionCallback; |
| 27 | 28 |
| 28 virtual void RequestQuotaPermission( | 29 virtual void RequestQuotaPermission( |
| 29 const GURL& origin_url, | 30 const StorageQuotaParams& params, |
| 30 quota::StorageType type, | |
| 31 int64 new_quota, | |
| 32 int render_process_id, | 31 int render_process_id, |
| 33 int render_view_id, | |
| 34 const PermissionCallback& callback) = 0; | 32 const PermissionCallback& callback) = 0; |
| 35 | 33 |
| 36 protected: | 34 protected: |
| 37 friend class base::RefCountedThreadSafe<QuotaPermissionContext>; | 35 friend class base::RefCountedThreadSafe<QuotaPermissionContext>; |
| 38 virtual ~QuotaPermissionContext() {} | 36 virtual ~QuotaPermissionContext() {} |
| 39 }; | 37 }; |
| 40 | 38 |
| 41 } // namespace content | 39 } // namespace content |
| 42 | 40 |
| 43 #endif // CONTENT_PUBLIC_BROWSER_QUOTA_PERMISSION_CONTEXT_H_ | 41 #endif // CONTENT_PUBLIC_BROWSER_QUOTA_PERMISSION_CONTEXT_H_ |
| OLD | NEW |