Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3700)

Unified Diff: chrome/browser/permissions/permission_manager.h

Issue 1260193009: renderer: implement multiple permission requesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions-request-multiple
Patch Set: Merge patches Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e861bf7b9ac58d541110cef43288103c9e9911b3 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 {
@@ -34,10 +38,19 @@ class PermissionManager : public KeyedService,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback) override;
+ void RequestPermissions(
+ const std::vector<content::PermissionType>& permissions,
+ content::RenderFrameHost* render_frame_host,
+ int request_id,
+ const GURL& requesting_origin,
+ bool user_gesture,
+ const base::Callback<void(const StatusVector&)>& callback) override;
void CancelPermissionRequest(content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
int request_id,
const GURL& requesting_origin) override;
+ void CancelPermissionsRequest(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 +72,18 @@ class PermissionManager : public KeyedService,
struct Subscription;
using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>;
+ struct PendingResponses;
+ struct PendingResponse;
Lalit Maganti (personal) 2015/08/03 23:10:26 Should be removed
+ using PendingResponseMap
+ = base::ScopedPtrHashMap<int, scoped_ptr<PendingResponses>>;
+
+ void OnRequestsResponse(
+ const base::Callback<void(const StatusVector&)>& 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 +92,8 @@ class PermissionManager : public KeyedService,
Profile* profile_;
SubscriptionsMap subscriptions_;
+ PendingResponseMap pending_batch_responses_;
+ base::WeakPtrFactory<PermissionManager> weak_ptr_factory_;
Lalit Maganti (personal) 2015/08/03 23:10:26 Comment about this being the last.
DISALLOW_COPY_AND_ASSIGN(PermissionManager);
};
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | chrome/browser/permissions/permission_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698