Index: chrome/browser/permissions/permission_manager.h |
diff --git a/chrome/browser/permissions/permission_manager.h b/chrome/browser/permissions/permission_manager.h |
index 044dfcda5a964765cc7a6a1ff6b7c9deba9affce..3b9bcdfd22e5beba424d17ac2c5c49da0ebf2b2f 100644 |
--- a/chrome/browser/permissions/permission_manager.h |
+++ b/chrome/browser/permissions/permission_manager.h |
@@ -6,13 +6,17 @@ |
#define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
#include "base/callback_forward.h" |
+#include "base/containers/scoped_ptr_hash_map.h" |
#include "base/id_map.h" |
#include "base/macros.h" |
+#include "base/memory/weak_ptr.h" |
#include "components/content_settings/core/browser/content_settings_observer.h" |
+#include "components/content_settings/core/common/content_settings.h" |
#include "components/keyed_service/core/keyed_service.h" |
#include "content/public/browser/permission_manager.h" |
+class PermissionRequestID; |
class Profile; |
namespace content { |
@@ -33,11 +37,16 @@ class PermissionManager : public KeyedService, |
int request_id, |
const GURL& requesting_origin, |
bool user_gesture, |
- const base::Callback<void(content::PermissionStatus)>& callback) override; |
- void CancelPermissionRequest(content::PermissionType permission, |
- content::RenderFrameHost* render_frame_host, |
- int request_id, |
- const GURL& requesting_origin) override; |
+ const RequestCallback& callback) override; |
+ void RequestPermission( |
+ const std::vector<content::PermissionType>& permissions, |
+ content::RenderFrameHost* render_frame_host, |
+ int request_id, |
+ const GURL& requesting_origin, |
+ bool user_gesture, |
+ const BatchRequestCallback& callback) override; |
+ void CancelPermissionRequest(content::RenderFrameHost* render_frame_host, |
+ int request_id) override; |
void ResetPermission(content::PermissionType permission, |
const GURL& requesting_origin, |
const GURL& embedding_origin) override; |
@@ -59,6 +68,26 @@ class PermissionManager : public KeyedService, |
struct Subscription; |
using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>; |
+ struct PendingResponses; |
+ struct PendingResponse; |
+ using PendingResponseMap |
+ = base::ScopedPtrHashMap<int, scoped_ptr<PendingResponses>>; |
+ |
+ void RequestPermissionInternal( |
+ const std::vector<content::PermissionType>& permissions, |
+ content::RenderFrameHost* render_frame_host, |
+ int request_id, |
+ const GURL& requesting_origin, |
+ bool user_gesture, |
+ const BatchRequestCallback& callback); |
+ |
+ void OnRequestResponse( |
+ const BatchRequestCallback& callback, |
+ const PermissionRequestID request, |
+ PendingResponses* pending_responses, |
+ int index, |
+ ContentSetting content_setting); |
+ |
// content_settings::Observer implementation. |
void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, |
const ContentSettingsPattern& secondary_pattern, |
@@ -67,6 +96,11 @@ class PermissionManager : public KeyedService, |
Profile* profile_; |
SubscriptionsMap subscriptions_; |
+ PendingResponseMap pending_responses_; |
+ |
+ // Need to keep this as the last member so it is destroyed before any other |
+ // fields. |
+ base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(PermissionManager); |
}; |