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

Unified Diff: chrome/browser/permissions/permission_infobar_delegate.cc

Issue 1332293002: permissions: switch from explicitly passing queue controller to callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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_infobar_delegate.cc
diff --git a/chrome/browser/permissions/permission_infobar_delegate.cc b/chrome/browser/permissions/permission_infobar_delegate.cc
index 418f03c62f55c8715c05dc1e0da4de1840be917b..f91c995a0cd618ca64f8fbc31dd016d4f3e6c057 100644
--- a/chrome/browser/permissions/permission_infobar_delegate.cc
+++ b/chrome/browser/permissions/permission_infobar_delegate.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/permissions/permission_infobar_delegate.h"
#include "chrome/browser/permissions/permission_context_uma_util.h"
-#include "chrome/browser/permissions/permission_queue_controller.h"
#include "chrome/grit/generated_resources.h"
#include "components/infobars/core/infobar.h"
#include "ui/base/l10n/l10n_util.h"
@@ -16,13 +15,13 @@ PermissionInfobarDelegate::~PermissionInfobarDelegate() {
}
PermissionInfobarDelegate::PermissionInfobarDelegate(
- PermissionQueueController* controller,
- const PermissionRequestID& id,
const GURL& requesting_origin,
- ContentSettingsType type)
- : controller_(controller), id_(id), requesting_origin_(requesting_origin),
+ ContentSettingsType type,
+ const base::Callback<void(bool, bool)>& callback)
+ : requesting_origin_(requesting_origin),
action_taken_(false),
- type_(type) {
+ type_(type),
+ callback_(callback) {
}
infobars::InfoBarDelegate::Type
@@ -58,9 +57,5 @@ bool PermissionInfobarDelegate::Cancel() {
void PermissionInfobarDelegate::SetPermission(bool update_content_setting,
bool allowed) {
action_taken_ = true;
- controller_->OnPermissionSet(
- id_, requesting_origin_,
- InfoBarService::WebContentsFromInfoBar(
- infobar())->GetLastCommittedURL().GetOrigin(),
- update_content_setting, allowed);
+ callback_.Run(update_content_setting, allowed);
}
« no previous file with comments | « chrome/browser/permissions/permission_infobar_delegate.h ('k') | chrome/browser/permissions/permission_queue_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698