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