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