summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 09:19:04 +0000
committertoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 09:19:04 +0000
commitc0561cc86a7dbcccfe6734bb31c4c3300c147b21 (patch)
tree5485bca9914503c6b077ac7ac63a09cec4a2221d
parent4af27103e51e25948d6000721a8ef4518619ba58 (diff)
downloadchromium_src-c0561cc86a7dbcccfe6734bb31c4c3300c147b21.zip
chromium_src-c0561cc86a7dbcccfe6734bb31c4c3300c147b21.tar.gz
chromium_src-c0561cc86a7dbcccfe6734bb31c4c3300c147b21.tar.bz2
Make PermissionQueueController available from other content settings
Make these stuff available from other content settings, e.g. Web MIDI. This change still have dependency from PermissionQueueController to GeolocationInfoBarDelegate. It will be removed by the following change. TEST=PermissionQueueControllerTests BUG=257618 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/19376004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213063 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/content_settings/permission_queue_controller.cc (renamed from chrome/browser/geolocation/geolocation_infobar_queue_controller.cc)85
-rw-r--r--chrome/browser/content_settings/permission_queue_controller.h (renamed from chrome/browser/geolocation/geolocation_infobar_queue_controller.h)38
-rw-r--r--chrome/browser/content_settings/permission_queue_controller_unittest.cc (renamed from chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc)30
-rw-r--r--chrome/browser/content_settings/permission_request_id.cc34
-rw-r--r--chrome/browser/content_settings/permission_request_id.h32
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context.cc34
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context.h25
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc4
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context_android.h4
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc32
-rw-r--r--chrome/browser/geolocation/geolocation_infobar_delegate.cc10
-rw-r--r--chrome/browser/geolocation/geolocation_infobar_delegate.h16
-rw-r--r--chrome/browser/geolocation/geolocation_infobar_delegate_android.cc4
-rw-r--r--chrome/browser/geolocation/geolocation_infobar_delegate_android.h4
-rw-r--r--chrome/browser/geolocation/geolocation_permission_request_id.cc36
-rw-r--r--chrome/browser/geolocation/geolocation_permission_request_id.h34
-rw-r--r--chrome/chrome_browser.gypi8
-rw-r--r--chrome/chrome_tests_unit.gypi2
18 files changed, 210 insertions, 222 deletions
diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc b/chrome/browser/content_settings/permission_queue_controller.cc
index 69eb13e..84a5592 100644
--- a/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc
+++ b/chrome/browser/content_settings/permission_queue_controller.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -21,11 +21,9 @@
#include "content/public/browser/web_contents.h"
-// Utilities ------------------------------------------------------------------
-
namespace {
-InfoBarService* GetInfoBarService(const GeolocationPermissionRequestID& id) {
+InfoBarService* GetInfoBarService(const PermissionRequestID& id) {
content::WebContents* web_contents =
tab_util::GetWebContentsByID(id.render_process_id(), id.render_view_id());
return web_contents ? InfoBarService::FromWebContents(web_contents) : NULL;
@@ -34,11 +32,9 @@ InfoBarService* GetInfoBarService(const GeolocationPermissionRequestID& id) {
}
-// GeolocationInfoBarQueueController::PendingInfoBarRequest -------------------
-
-class GeolocationInfoBarQueueController::PendingInfoBarRequest {
+class PermissionQueueController::PendingInfoBarRequest {
public:
- PendingInfoBarRequest(const GeolocationPermissionRequestID& id,
+ PendingInfoBarRequest(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
PermissionDecidedCallback callback);
@@ -47,17 +43,17 @@ class GeolocationInfoBarQueueController::PendingInfoBarRequest {
bool IsForPair(const GURL& requesting_frame,
const GURL& embedder) const;
- const GeolocationPermissionRequestID& id() const { return id_; }
+ const PermissionRequestID& id() const { return id_; }
const GURL& requesting_frame() const { return requesting_frame_; }
bool has_infobar() const { return !!infobar_; }
InfoBarDelegate* infobar() { return infobar_; }
void RunCallback(bool allowed);
- void CreateInfoBar(GeolocationInfoBarQueueController* controller,
+ void CreateInfoBar(PermissionQueueController* controller,
const std::string& display_languages);
private:
- GeolocationPermissionRequestID id_;
+ PermissionRequestID id_;
GURL requesting_frame_;
GURL embedder_;
PermissionDecidedCallback callback_;
@@ -66,8 +62,8 @@ class GeolocationInfoBarQueueController::PendingInfoBarRequest {
// Purposefully do not disable copying, as this is stored in STL containers.
};
-GeolocationInfoBarQueueController::PendingInfoBarRequest::PendingInfoBarRequest(
- const GeolocationPermissionRequestID& id,
+PermissionQueueController::PendingInfoBarRequest::PendingInfoBarRequest(
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
PermissionDecidedCallback callback)
@@ -78,42 +74,41 @@ GeolocationInfoBarQueueController::PendingInfoBarRequest::PendingInfoBarRequest(
infobar_(NULL) {
}
-GeolocationInfoBarQueueController::PendingInfoBarRequest::
- ~PendingInfoBarRequest() {
+PermissionQueueController::PendingInfoBarRequest::~PendingInfoBarRequest() {
}
-bool GeolocationInfoBarQueueController::PendingInfoBarRequest::IsForPair(
+bool PermissionQueueController::PendingInfoBarRequest::IsForPair(
const GURL& requesting_frame,
const GURL& embedder) const {
return (requesting_frame_ == requesting_frame) && (embedder_ == embedder);
}
-void GeolocationInfoBarQueueController::PendingInfoBarRequest::RunCallback(
+void PermissionQueueController::PendingInfoBarRequest::RunCallback(
bool allowed) {
callback_.Run(allowed);
}
-void GeolocationInfoBarQueueController::PendingInfoBarRequest::
- CreateInfoBar(GeolocationInfoBarQueueController* controller,
- const std::string& display_languages) {
+void PermissionQueueController::PendingInfoBarRequest::CreateInfoBar(
+ PermissionQueueController* controller,
+ const std::string& display_languages) {
+ // TODO(toyoshim): Remove following dependency on geolocation.
infobar_ = GeolocationInfoBarDelegate::Create(
GetInfoBarService(id_), controller, id_, requesting_frame_,
display_languages);
}
-// GeolocationInfoBarQueueController ------------------------------------------
-
-GeolocationInfoBarQueueController::GeolocationInfoBarQueueController(
- Profile* profile)
- : profile_(profile) {
+PermissionQueueController::PermissionQueueController(
+ Profile* profile, ContentSettingsType type)
+ : profile_(profile),
+ type_(type) {
}
-GeolocationInfoBarQueueController::~GeolocationInfoBarQueueController() {
+PermissionQueueController::~PermissionQueueController() {
}
-void GeolocationInfoBarQueueController::CreateInfoBarRequest(
- const GeolocationPermissionRequestID& id,
+void PermissionQueueController::CreateInfoBarRequest(
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
PermissionDecidedCallback callback) {
@@ -131,8 +126,8 @@ void GeolocationInfoBarQueueController::CreateInfoBarRequest(
ShowQueuedInfoBarForTab(id);
}
-void GeolocationInfoBarQueueController::CancelInfoBarRequest(
- const GeolocationPermissionRequestID& id) {
+void PermissionQueueController::CancelInfoBarRequest(
+ const PermissionRequestID& id) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
for (PendingInfoBarRequests::iterator i(pending_infobar_requests_.begin());
@@ -147,8 +142,8 @@ void GeolocationInfoBarQueueController::CancelInfoBarRequest(
}
}
-void GeolocationInfoBarQueueController::OnPermissionSet(
- const GeolocationPermissionRequestID& id,
+void PermissionQueueController::OnPermissionSet(
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
bool update_content_setting,
@@ -197,7 +192,7 @@ void GeolocationInfoBarQueueController::OnPermissionSet(
i->RunCallback(allowed);
}
-void GeolocationInfoBarQueueController::Observe(
+void PermissionQueueController::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
@@ -216,7 +211,7 @@ void GeolocationInfoBarQueueController::Observe(
for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin();
i != pending_infobar_requests_.end(); ++i) {
if (i->infobar() == infobar) {
- GeolocationPermissionRequestID id(i->id());
+ PermissionRequestID id(i->id());
pending_infobar_requests_.erase(i);
ShowQueuedInfoBarForTab(id);
return;
@@ -224,8 +219,8 @@ void GeolocationInfoBarQueueController::Observe(
}
}
-bool GeolocationInfoBarQueueController::AlreadyShowingInfoBarForTab(
- const GeolocationPermissionRequestID& id) const {
+bool PermissionQueueController::AlreadyShowingInfoBarForTab(
+ const PermissionRequestID& id) const {
for (PendingInfoBarRequests::const_iterator i(
pending_infobar_requests_.begin());
i != pending_infobar_requests_.end(); ++i) {
@@ -235,8 +230,8 @@ bool GeolocationInfoBarQueueController::AlreadyShowingInfoBarForTab(
return false;
}
-void GeolocationInfoBarQueueController::ShowQueuedInfoBarForTab(
- const GeolocationPermissionRequestID& id) {
+void PermissionQueueController::ShowQueuedInfoBarForTab(
+ const PermissionRequestID& id) {
DCHECK(!AlreadyShowingInfoBarForTab(id));
InfoBarService* infobar_service = GetInfoBarService(id);
@@ -264,8 +259,8 @@ void GeolocationInfoBarQueueController::ShowQueuedInfoBarForTab(
UnregisterForInfoBarNotifications(infobar_service);
}
-void GeolocationInfoBarQueueController::ClearPendingInfoBarRequestsForTab(
- const GeolocationPermissionRequestID& id) {
+void PermissionQueueController::ClearPendingInfoBarRequestsForTab(
+ const PermissionRequestID& id) {
for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin();
i != pending_infobar_requests_.end(); ) {
if (i->id().IsForSameTabAs(id)) {
@@ -277,7 +272,7 @@ void GeolocationInfoBarQueueController::ClearPendingInfoBarRequestsForTab(
}
}
-void GeolocationInfoBarQueueController::RegisterForInfoBarNotifications(
+void PermissionQueueController::RegisterForInfoBarNotifications(
InfoBarService* infobar_service) {
if (!registrar_.IsRegistered(
this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
@@ -288,7 +283,7 @@ void GeolocationInfoBarQueueController::RegisterForInfoBarNotifications(
}
}
-void GeolocationInfoBarQueueController::UnregisterForInfoBarNotifications(
+void PermissionQueueController::UnregisterForInfoBarNotifications(
InfoBarService* infobar_service) {
if (registrar_.IsRegistered(
this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
@@ -299,7 +294,7 @@ void GeolocationInfoBarQueueController::UnregisterForInfoBarNotifications(
}
}
-void GeolocationInfoBarQueueController::UpdateContentSetting(
+void PermissionQueueController::UpdateContentSetting(
const GURL& requesting_frame,
const GURL& embedder,
bool allowed) {
@@ -315,7 +310,7 @@ void GeolocationInfoBarQueueController::UpdateContentSetting(
profile_->GetHostContentSettingsMap()->SetContentSetting(
ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()),
ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ type_,
std::string(),
content_setting);
}
diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller.h b/chrome/browser/content_settings/permission_queue_controller.h
index cc87cba..3da215b 100644
--- a/chrome/browser/geolocation/geolocation_infobar_queue_controller.h
+++ b/chrome/browser/content_settings/permission_queue_controller.h
@@ -1,48 +1,49 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_QUEUE_CONTROLLER_H_
-#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_QUEUE_CONTROLLER_H_
+#ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_QUEUE_CONTROLLER_H_
+#define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_QUEUE_CONTROLLER_H_
#include "base/bind.h"
+#include "chrome/common/content_settings_types.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
class GURL;
-class GeolocationPermissionRequestID;
+class PermissionRequestID;
class InfoBarService;
class Profile;
-// This class controls the geolocation infobar queue per profile, and it's
-// used by GeolocationPermissionContext.
+// This class controls an infobar queue per profile, and it's used by
+// GeolocationPermissionContext, and so on.
// An alternate approach would be to have this queue per tab, and use
// notifications to broadcast when permission is set / listen to notification to
// cancel pending requests. This may be specially useful if there are other
// things listening for such notifications.
// For the time being this class is self-contained and it doesn't seem pulling
// the notification infrastructure would simplify.
-class GeolocationInfoBarQueueController : content::NotificationObserver {
+class PermissionQueueController : content::NotificationObserver {
public:
typedef base::Callback<void(bool /* allowed */)> PermissionDecidedCallback;
- explicit GeolocationInfoBarQueueController(Profile* profile);
- virtual ~GeolocationInfoBarQueueController();
+ PermissionQueueController(Profile* profile, ContentSettingsType type);
+ virtual ~PermissionQueueController();
// The InfoBar will be displayed immediately if the tab is not already
// displaying one, otherwise it'll be queued.
- void CreateInfoBarRequest(const GeolocationPermissionRequestID& id,
+ void CreateInfoBarRequest(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
PermissionDecidedCallback callback);
// Cancels a specific infobar request.
- void CancelInfoBarRequest(const GeolocationPermissionRequestID& id);
+ void CancelInfoBarRequest(const PermissionRequestID& id);
// Called by the InfoBarDelegate to notify permission has been set.
// It'll notify and dismiss any other pending InfoBar request for the same
// |requesting_frame| and embedder.
- void OnPermissionSet(const GeolocationPermissionRequestID& id,
+ void OnPermissionSet(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
bool update_content_setting,
@@ -62,18 +63,16 @@ class GeolocationInfoBarQueueController : content::NotificationObserver {
// Returns true if a geolocation infobar is already visible for the tab
// corresponding to |id|.
- bool AlreadyShowingInfoBarForTab(
- const GeolocationPermissionRequestID& id) const;
+ bool AlreadyShowingInfoBarForTab(const PermissionRequestID& id) const;
// Shows the next pending infobar for the tab corresponding to |id|, if any.
// Note that this may not be the pending request whose ID is |id| if other
// requests are higher in the queue. If we can't show infobars because there
// is no InfoBarService for this tab, removes all queued requests for this
// tab.
- void ShowQueuedInfoBarForTab(const GeolocationPermissionRequestID& id);
+ void ShowQueuedInfoBarForTab(const PermissionRequestID& id);
- void ClearPendingInfoBarRequestsForTab(
- const GeolocationPermissionRequestID& id);
+ void ClearPendingInfoBarRequestsForTab(const PermissionRequestID& id);
void RegisterForInfoBarNotifications(InfoBarService* infobar_service);
void UnregisterForInfoBarNotifications(InfoBarService* infobar_service);
@@ -84,9 +83,10 @@ class GeolocationInfoBarQueueController : content::NotificationObserver {
content::NotificationRegistrar registrar_;
Profile* const profile_;
+ ContentSettingsType type_;
PendingInfoBarRequests pending_infobar_requests_;
- DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarQueueController);
+ DISALLOW_COPY_AND_ASSIGN(PermissionQueueController);
};
-#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_QUEUE_CONTROLLER_H_
+#endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_QUEUE_CONTROLLER_H_
diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc b/chrome/browser/content_settings/permission_queue_controller_unittest.cc
index 10f563c..8ff0a21 100644
--- a/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc
+++ b/chrome/browser/content_settings/permission_queue_controller_unittest.cc
@@ -1,12 +1,13 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
#include "base/synchronization/waitable_event.h"
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/common/content_settings_types.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/web_contents.h"
@@ -14,24 +15,22 @@
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
-class GeolocationInfoBarQueueControllerTests
- : public ChromeRenderViewHostTestHarness {
+class PermissionQueueControllerTests : public ChromeRenderViewHostTestHarness {
protected:
virtual void SetUp() OVERRIDE {
ChromeRenderViewHostTestHarness::SetUp();
InfoBarService::CreateForWebContents(web_contents());
}
- GeolocationPermissionRequestID RequestID(int bridge_id) {
- return GeolocationPermissionRequestID(
+ PermissionRequestID RequestID(int bridge_id) {
+ return PermissionRequestID(
web_contents()->GetRenderProcessHost()->GetID(),
web_contents()->GetRenderViewHost()->GetRoutingID(),
bridge_id);
}
};
-class ObservationCountingQueueController :
- public GeolocationInfoBarQueueController {
+class ObservationCountingQueueController : public PermissionQueueController {
public:
explicit ObservationCountingQueueController(Profile* profile);
@@ -40,12 +39,12 @@ class ObservationCountingQueueController :
private:
int call_count_;
- // GeolocationInfoBarQueueController
+ // PermissionQueueController
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- static void NotifyPermissionSet(const GeolocationPermissionRequestID& id,
+ static void NotifyPermissionSet(const PermissionRequestID& id,
const GURL& requesting_frame,
base::Callback<void(bool)> callback,
bool allowed);
@@ -53,8 +52,7 @@ class ObservationCountingQueueController :
ObservationCountingQueueController::ObservationCountingQueueController(
Profile* profile)
- : GeolocationInfoBarQueueController(
- profile),
+ : PermissionQueueController(profile, CONTENT_SETTINGS_TYPE_GEOLOCATION),
call_count_(0) {
}
@@ -63,18 +61,18 @@ void ObservationCountingQueueController::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
++call_count_;
- GeolocationInfoBarQueueController::Observe(type, source, details);
+ PermissionQueueController::Observe(type, source, details);
}
void ObservationCountingQueueController::NotifyPermissionSet(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
base::Callback<void(bool)> callback,
bool allowed) {
}
-TEST_F(GeolocationInfoBarQueueControllerTests,
+TEST_F(PermissionQueueControllerTests,
OneObservationPerInfoBarCancelled) {
// When an infobar is cancelled, the infobar helper sends a notification to
// the controller. If the controller has another infobar queued, it should
diff --git a/chrome/browser/content_settings/permission_request_id.cc b/chrome/browser/content_settings/permission_request_id.cc
new file mode 100644
index 0000000..ec47459
--- /dev/null
+++ b/chrome/browser/content_settings/permission_request_id.cc
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/content_settings/permission_request_id.h"
+
+#include "base/strings/stringprintf.h"
+
+
+PermissionRequestID::PermissionRequestID(int render_process_id,
+ int render_view_id,
+ int bridge_id)
+ : render_process_id_(render_process_id),
+ render_view_id_(render_view_id),
+ bridge_id_(bridge_id) {
+}
+
+PermissionRequestID::~PermissionRequestID() {
+}
+
+bool PermissionRequestID::Equals(const PermissionRequestID& other) const {
+ return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_);
+}
+
+bool PermissionRequestID::IsForSameTabAs(
+ const PermissionRequestID& other) const {
+ return (render_process_id_ == other.render_process_id_) &&
+ (render_view_id_ == other.render_view_id_);
+}
+
+std::string PermissionRequestID::ToString() const {
+ return base::StringPrintf("%d,%d,%d", render_process_id_, render_view_id_,
+ bridge_id_);
+}
diff --git a/chrome/browser/content_settings/permission_request_id.h b/chrome/browser/content_settings/permission_request_id.h
new file mode 100644
index 0000000..14bc274
--- /dev/null
+++ b/chrome/browser/content_settings/permission_request_id.h
@@ -0,0 +1,32 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
+#define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
+
+#include <string>
+
+// Uniquely identifies a particular permission request.
+class PermissionRequestID {
+ public:
+ PermissionRequestID(int render_process_id, int render_view_id, int bridge_id);
+ ~PermissionRequestID();
+
+ int render_process_id() const { return render_process_id_; }
+ int render_view_id() const { return render_view_id_; }
+ int bridge_id() const { return bridge_id_; }
+
+ bool Equals(const PermissionRequestID& other) const;
+ bool IsForSameTabAs(const PermissionRequestID& other) const;
+ std::string ToString() const;
+
+ private:
+ int render_process_id_;
+ int render_view_id_;
+ int bridge_id_;
+
+ // Purposefully do not disable copying, as this is stored in STL containers.
+};
+
+#endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index cdf6bc4..e3bfc92 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -11,12 +11,11 @@
#include "base/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/suggest_permission_util.h"
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/common/extensions/extension.h"
@@ -35,9 +34,9 @@ ChromeGeolocationPermissionContext::ChromeGeolocationPermissionContext(
ChromeGeolocationPermissionContext::~ChromeGeolocationPermissionContext() {
// ChromeGeolocationPermissionContext may be destroyed on either the UI thread
- // or the IO thread, but the GeolocationInfobarQueueController must have been
+ // or the IO thread, but the PermissionQueueController must have been
// destroyed on the UI thread.
- DCHECK(!geolocation_infobar_queue_controller_.get());
+ DCHECK(!permission_queue_controller_.get());
}
void ChromeGeolocationPermissionContext::RequestGeolocationPermission(
@@ -62,7 +61,7 @@ void ChromeGeolocationPermissionContext::RequestGeolocationPermission(
content::WebContents* web_contents =
tab_util::GetWebContentsByID(render_process_id, render_view_id);
- const GeolocationPermissionRequestID id(render_process_id, render_view_id,
+ const PermissionRequestID id(render_process_id, render_view_id,
bridge_id);
ExtensionService* extension_service =
extensions::ExtensionSystem::Get(profile_)->extension_service();
@@ -112,12 +111,12 @@ void ChromeGeolocationPermissionContext::CancelGeolocationPermissionRequest(
int render_view_id,
int bridge_id,
const GURL& requesting_frame) {
- CancelPendingInfoBarRequest(GeolocationPermissionRequestID(
+ CancelPendingInfoBarRequest(PermissionRequestID(
render_process_id, render_view_id, bridge_id));
}
void ChromeGeolocationPermissionContext::DecidePermission(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback) {
@@ -145,12 +144,12 @@ void ChromeGeolocationPermissionContext::DecidePermission(
void ChromeGeolocationPermissionContext::ShutdownOnUIThread() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- geolocation_infobar_queue_controller_.reset();
+ permission_queue_controller_.reset();
shutting_down_ = true;
}
void ChromeGeolocationPermissionContext::PermissionDecided(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback,
@@ -159,7 +158,7 @@ void ChromeGeolocationPermissionContext::PermissionDecided(
}
void ChromeGeolocationPermissionContext::NotifyPermissionSet(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
base::Callback<void(bool)> callback,
bool allowed) {
@@ -177,23 +176,24 @@ void ChromeGeolocationPermissionContext::NotifyPermissionSet(
callback.Run(allowed);
}
-GeolocationInfoBarQueueController*
+PermissionQueueController*
ChromeGeolocationPermissionContext::QueueController() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
DCHECK(!shutting_down_);
- if (!geolocation_infobar_queue_controller_)
- geolocation_infobar_queue_controller_.reset(CreateQueueController());
- return geolocation_infobar_queue_controller_.get();
+ if (!permission_queue_controller_)
+ permission_queue_controller_.reset(CreateQueueController());
+ return permission_queue_controller_.get();
}
-GeolocationInfoBarQueueController*
+PermissionQueueController*
ChromeGeolocationPermissionContext::CreateQueueController() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- return new GeolocationInfoBarQueueController(profile());
+ return new PermissionQueueController(profile(),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION);
}
void ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest(
- const GeolocationPermissionRequestID& id) {
+ const PermissionRequestID& id) {
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.h b/chrome/browser/geolocation/chrome_geolocation_permission_context.h
index fde8d5a..06b324d 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.h
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.h
@@ -8,15 +8,15 @@
#include <string>
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
#include "content/public/browser/geolocation_permission_context.h"
-class GeolocationPermissionRequestID;
+class PermissionRequestID;
class Profile;
// Chrome specific implementation of GeolocationPermissionContext; manages
// Geolocation permissions flow, and delegates UI handling via
-// GeolocationInfoBarQueueController.
+// PermissionQueueController.
class ChromeGeolocationPermissionContext
: public content::GeolocationPermissionContext {
public:
@@ -45,13 +45,13 @@ class ChromeGeolocationPermissionContext
// Return an instance of the infobar queue controller, creating it
// if necessary.
- GeolocationInfoBarQueueController* QueueController();
+ PermissionQueueController* QueueController();
// Notifies whether or not the corresponding bridge is allowed to use
// geolocation via
// GeolocationPermissionContext::SetGeolocationPermissionResponse().
// Called on the UI thread.
- void NotifyPermissionSet(const GeolocationPermissionRequestID& id,
+ void NotifyPermissionSet(const PermissionRequestID& id,
const GURL& requesting_frame,
base::Callback<void(bool)> callback,
bool allowed);
@@ -61,7 +61,7 @@ class ChromeGeolocationPermissionContext
// Calls PermissionDecided if permission can be decided non-interactively,
// or NotifyPermissionSet if permission decided by presenting an
// infobar to the user. Called on the UI thread.
- virtual void DecidePermission(const GeolocationPermissionRequestID& id,
+ virtual void DecidePermission(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback);
@@ -70,25 +70,24 @@ class ChromeGeolocationPermissionContext
// the user. Can be overridden to introduce additional UI flow.
// Should ultimately ensure that NotifyPermissionSet is called.
// Called on the UI thread.
- virtual void PermissionDecided(const GeolocationPermissionRequestID& id,
+ virtual void PermissionDecided(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback,
bool allowed);
- // Create an InfoBarQueueController. overriden in derived classes to provide
- // additional UI flow. Called on the UI thread.
- virtual GeolocationInfoBarQueueController* CreateQueueController();
+ // Create an PermissionQueueController. overriden in derived classes to
+ // provide additional UI flow. Called on the UI thread.
+ virtual PermissionQueueController* CreateQueueController();
private:
// Removes any pending InfoBar request.
- void CancelPendingInfoBarRequest(const GeolocationPermissionRequestID& id);
+ void CancelPendingInfoBarRequest(const PermissionRequestID& id);
// These must only be accessed from the UI thread.
Profile* const profile_;
bool shutting_down_;
- scoped_ptr<GeolocationInfoBarQueueController>
- geolocation_infobar_queue_controller_;
+ scoped_ptr<PermissionQueueController> permission_queue_controller_;
DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContext);
};
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
index 3a8a978..afb213c 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
@@ -22,7 +22,7 @@ ChromeGeolocationPermissionContextAndroid::
}
void ChromeGeolocationPermissionContextAndroid::DecidePermission(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback) {
@@ -41,7 +41,7 @@ void ChromeGeolocationPermissionContextAndroid::DecidePermission(
}
void ChromeGeolocationPermissionContextAndroid::PermissionDecided(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback,
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h
index 0dbed899..c14f224 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h
@@ -22,12 +22,12 @@ class ChromeGeolocationPermissionContextAndroid
virtual ~ChromeGeolocationPermissionContextAndroid();
// ChromeGeolocationPermissionContext implementation:
- virtual void DecidePermission(const GeolocationPermissionRequestID& id,
+ virtual void DecidePermission(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback) OVERRIDE;
- virtual void PermissionDecided(const GeolocationPermissionRequestID& id,
+ virtual void PermissionDecided(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
base::Callback<void(bool)> callback,
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
index 10eae81..7a1c0e5 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
@@ -14,9 +14,9 @@
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h"
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
@@ -101,8 +101,8 @@ class GeolocationPermissionContextTests
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
- GeolocationPermissionRequestID RequestID(int bridge_id);
- GeolocationPermissionRequestID RequestIDForTab(int tab, int bridge_id);
+ PermissionRequestID RequestID(int bridge_id);
+ PermissionRequestID RequestIDForTab(int tab, int bridge_id);
InfoBarService* infobar_service() {
return InfoBarService::FromWebContents(web_contents());
}
@@ -110,12 +110,11 @@ class GeolocationPermissionContextTests
return InfoBarService::FromWebContents(extra_tabs_[tab]);
}
- void RequestGeolocationPermission(const GeolocationPermissionRequestID& id,
+ void RequestGeolocationPermission(const PermissionRequestID& id,
const GURL& requesting_frame);
- void CancelGeolocationPermissionRequest(
- const GeolocationPermissionRequestID& id,
- const GURL& requesting_frame);
- void PermissionResponse(const GeolocationPermissionRequestID& id,
+ void CancelGeolocationPermissionRequest(const PermissionRequestID& id,
+ const GURL& requesting_frame);
+ void PermissionResponse(const PermissionRequestID& id,
bool allowed);
void CheckPermissionMessageSent(int bridge_id, bool allowed);
void CheckPermissionMessageSentForTab(int tab, int bridge_id, bool allowed);
@@ -136,24 +135,25 @@ class GeolocationPermissionContextTests
base::hash_map<int, std::pair<int, bool> > responses_;
};
-GeolocationPermissionRequestID GeolocationPermissionContextTests::RequestID(
+PermissionRequestID GeolocationPermissionContextTests::RequestID(
int bridge_id) {
- return GeolocationPermissionRequestID(
+ return PermissionRequestID(
web_contents()->GetRenderProcessHost()->GetID(),
web_contents()->GetRenderViewHost()->GetRoutingID(),
bridge_id);
}
-GeolocationPermissionRequestID
- GeolocationPermissionContextTests::RequestIDForTab(int tab, int bridge_id) {
- return GeolocationPermissionRequestID(
+PermissionRequestID GeolocationPermissionContextTests::RequestIDForTab(
+ int tab,
+ int bridge_id) {
+ return PermissionRequestID(
extra_tabs_[tab]->GetRenderProcessHost()->GetID(),
extra_tabs_[tab]->GetRenderViewHost()->GetRoutingID(),
bridge_id);
}
void GeolocationPermissionContextTests::RequestGeolocationPermission(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame) {
geolocation_permission_context_->RequestGeolocationPermission(
id.render_process_id(), id.render_view_id(), id.bridge_id(),
@@ -163,7 +163,7 @@ void GeolocationPermissionContextTests::RequestGeolocationPermission(
}
void GeolocationPermissionContextTests::CancelGeolocationPermissionRequest(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
const GURL& requesting_frame) {
geolocation_permission_context_->CancelGeolocationPermissionRequest(
id.render_process_id(), id.render_view_id(), id.bridge_id(),
@@ -171,7 +171,7 @@ void GeolocationPermissionContextTests::CancelGeolocationPermissionRequest(
}
void GeolocationPermissionContextTests::PermissionResponse(
- const GeolocationPermissionRequestID& id,
+ const PermissionRequestID& id,
bool allowed) {
responses_[id.render_process_id()] = std::make_pair(id.bridge_id(), allowed);
}
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
index 017c570..4e9c37d 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/geolocation/geolocation_infobar_delegate.h"
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "content/public/browser/navigation_details.h"
@@ -27,8 +27,8 @@ typedef GeolocationInfoBarDelegate DelegateType;
// static
InfoBarDelegate* GeolocationInfoBarDelegate::Create(
InfoBarService* infobar_service,
- GeolocationInfoBarQueueController* controller,
- const GeolocationPermissionRequestID& id,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const std::string& display_languages) {
const content::NavigationEntry* committed_entry =
@@ -41,8 +41,8 @@ InfoBarDelegate* GeolocationInfoBarDelegate::Create(
GeolocationInfoBarDelegate::GeolocationInfoBarDelegate(
InfoBarService* infobar_service,
- GeolocationInfoBarQueueController* controller,
- const GeolocationPermissionRequestID& id,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
int contents_unique_id,
const std::string& display_languages)
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.h b/chrome/browser/geolocation/geolocation_infobar_delegate.h
index 4e63f64..93a6ab7 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.h
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.h
@@ -7,11 +7,11 @@
#include <string>
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "url/gurl.h"
-class GeolocationInfoBarQueueController;
+class PermissionQueueController;
class InfoBarService;
// GeolocationInfoBarDelegates are created by the
@@ -22,15 +22,15 @@ class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate {
// Creates a geolocation infobar delegate and adds it to |infobar_service|.
// Returns the delegate if it was successfully added.
static InfoBarDelegate* Create(InfoBarService* infobar_service,
- GeolocationInfoBarQueueController* controller,
- const GeolocationPermissionRequestID& id,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
const std::string& display_languages);
protected:
GeolocationInfoBarDelegate(InfoBarService* infobar_service,
- GeolocationInfoBarQueueController* controller,
- const GeolocationPermissionRequestID& id,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
const GURL& requesting_frame,
int contents_unique_id,
const std::string& display_languages);
@@ -54,8 +54,8 @@ class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate {
virtual string16 GetLinkText() const OVERRIDE;
virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
- GeolocationInfoBarQueueController* controller_;
- const GeolocationPermissionRequestID id_;
+ PermissionQueueController* controller_;
+ const PermissionRequestID id_;
GURL requesting_frame_;
int contents_unique_id_;
std::string display_languages_;
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc
index 032b7f4..52c2b5b 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc
@@ -13,8 +13,8 @@
GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid(
InfoBarService* infobar_service,
- GeolocationInfoBarQueueController* controller,
- const GeolocationPermissionRequestID& id,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
const GURL& requesting_frame_url,
int contents_unique_id,
const std::string& display_languages)
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h
index f5059e3..e247f7f 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h
@@ -14,8 +14,8 @@ class GeolocationInfoBarDelegateAndroid : public GeolocationInfoBarDelegate {
public:
GeolocationInfoBarDelegateAndroid(
InfoBarService* infobar_service,
- GeolocationInfoBarQueueController* controller,
- const GeolocationPermissionRequestID& id,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
const GURL& requesting_frame_url,
int contents_unique_id,
const std::string& display_languages);
diff --git a/chrome/browser/geolocation/geolocation_permission_request_id.cc b/chrome/browser/geolocation/geolocation_permission_request_id.cc
deleted file mode 100644
index 89df8c4..0000000
--- a/chrome/browser/geolocation/geolocation_permission_request_id.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
-
-#include "base/strings/stringprintf.h"
-
-
-GeolocationPermissionRequestID::GeolocationPermissionRequestID(
- int render_process_id,
- int render_view_id,
- int bridge_id)
- : render_process_id_(render_process_id),
- render_view_id_(render_view_id),
- bridge_id_(bridge_id) {
-}
-
-GeolocationPermissionRequestID::~GeolocationPermissionRequestID() {
-}
-
-bool GeolocationPermissionRequestID::Equals(
- const GeolocationPermissionRequestID& other) const {
- return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_);
-}
-
-bool GeolocationPermissionRequestID::IsForSameTabAs(
- const GeolocationPermissionRequestID& other) const {
- return (render_process_id_ == other.render_process_id_) &&
- (render_view_id_ == other.render_view_id_);
-}
-
-std::string GeolocationPermissionRequestID::ToString() const {
- return base::StringPrintf("%d,%d,%d", render_process_id_, render_view_id_,
- bridge_id_);
-}
diff --git a/chrome/browser/geolocation/geolocation_permission_request_id.h b/chrome/browser/geolocation/geolocation_permission_request_id.h
deleted file mode 100644
index eb29de9..0000000
--- a/chrome/browser/geolocation/geolocation_permission_request_id.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_REQUEST_ID_H_
-#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_REQUEST_ID_H_
-
-#include <string>
-
-// Uniquely identifies a particular geolocation permission request.
-class GeolocationPermissionRequestID {
- public:
- GeolocationPermissionRequestID(int render_process_id,
- int render_view_id,
- int bridge_id);
- ~GeolocationPermissionRequestID();
-
- int render_process_id() const { return render_process_id_; }
- int render_view_id() const { return render_view_id_; }
- int bridge_id() const { return bridge_id_; }
-
- bool Equals(const GeolocationPermissionRequestID& other) const;
- bool IsForSameTabAs(const GeolocationPermissionRequestID& other) const;
- std::string ToString() const;
-
- private:
- int render_process_id_;
- int render_view_id_;
- int bridge_id_;
-
- // Purposefully do not disable copying, as this is stored in STL containers.
-};
-
-#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_REQUEST_ID_H_
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 689bcfb8..245d507 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -439,6 +439,10 @@
'browser/content_settings/host_content_settings_map.h',
'browser/content_settings/local_shared_objects_container.cc',
'browser/content_settings/local_shared_objects_container.h',
+ 'browser/content_settings/permission_queue_controller.cc',
+ 'browser/content_settings/permission_queue_controller.h',
+ 'browser/content_settings/permission_request_id.cc',
+ 'browser/content_settings/permission_request_id.h',
'browser/content_settings/tab_specific_content_settings.cc',
'browser/content_settings/tab_specific_content_settings.h',
'browser/crash_upload_list.cc',
@@ -603,10 +607,6 @@
'browser/geolocation/geolocation_infobar_delegate.h',
'browser/geolocation/geolocation_infobar_delegate_android.cc',
'browser/geolocation/geolocation_infobar_delegate_android.h',
- 'browser/geolocation/geolocation_infobar_queue_controller.cc',
- 'browser/geolocation/geolocation_infobar_queue_controller.h',
- 'browser/geolocation/geolocation_permission_request_id.cc',
- 'browser/geolocation/geolocation_permission_request_id.h',
'browser/geolocation/geolocation_prefs.cc',
'browser/geolocation/geolocation_prefs.h',
'browser/global_keyboard_shortcuts_mac.h',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 3a99b16..83329b7 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -717,6 +717,7 @@
'browser/content_settings/host_content_settings_map_unittest.cc',
'browser/content_settings/mock_settings_observer.cc',
'browser/content_settings/mock_settings_observer.h',
+ 'browser/content_settings/permission_queue_controller_unittest.cc',
'browser/content_settings/tab_specific_content_settings_unittest.cc',
'browser/custom_handlers/protocol_handler_registry_unittest.cc',
'browser/diagnostics/diagnostics_model_unittest.cc',
@@ -859,7 +860,6 @@
'browser/file_select_helper_unittest.cc',
'browser/first_run/first_run_unittest.cc',
'browser/geolocation/chrome_geolocation_permission_context_unittest.cc',
- 'browser/geolocation/geolocation_infobar_queue_controller_unittest.cc',
'browser/global_keyboard_shortcuts_mac_unittest.mm',
'browser/google/google_search_counter_unittest.cc',
'browser/google/google_update_settings_unittest.cc',