Index: chrome/browser/content_settings/permission_queue_controller.cc |
diff --git a/chrome/browser/content_settings/permission_queue_controller.cc b/chrome/browser/content_settings/permission_queue_controller.cc |
index 480f6a78cdd460252c6a04cc7b1bb79d7297c399..0985e83173a8f15be2e7e5706cc473c533d126f2 100644 |
--- a/chrome/browser/content_settings/permission_queue_controller.cc |
+++ b/chrome/browser/content_settings/permission_queue_controller.cc |
@@ -176,6 +176,34 @@ void PermissionQueueController::CancelInfoBarRequest( |
} |
} |
+void PermissionQueueController::CancelInfoBarRequests(int group_id) { |
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
+ |
+ PendingInfoBarRequests infobars_to_remove; |
xhwang
2013/12/30 19:00:59
s/infobars_to_remove/info_bar_requests_to_cancel/
Kibeom Kim (inactive)
2013/12/30 21:52:24
Done.
|
+ for (PendingInfoBarRequests::iterator i(pending_infobar_requests_.begin()); |
xhwang
2013/12/30 19:00:59
nit: InfoBar/info_bar or Infobar/infobar. Now the
xhwang
2013/12/30 19:00:59
nit: typically we use PendingInfoBarRequests::iter
Kibeom Kim (inactive)
2013/12/30 21:52:24
Done. (seems InfoBar naming is largely inconsisten
|
+ i != pending_infobar_requests_.end();) { |
+ LOG(ERROR) << "KKIM: " |
+ << "CancelInfoBarRequests PermissionRequestID == " |
+ << i->id().ToString(); |
xhwang
2013/12/30 19:00:59
Remove? Or at least not to use LOG(ERROR) and KKIM
Kibeom Kim (inactive)
2013/12/30 21:52:24
Done. :)
|
+ if (i->id().group_id() == group_id) { |
+ if (i->has_infobar()) { |
+ infobars_to_remove.push_back(*i); |
xhwang
2013/12/30 19:00:59
Can we call GetInfoBarService(i->id())->RemoveInfo
Kibeom Kim (inactive)
2013/12/30 21:52:24
I tried that first, but then, at RemoveInfoBar(..)
xhwang
2013/12/30 21:59:39
worth a comment?
Kibeom Kim (inactive)
2013/12/30 22:10:09
Done.
|
+ ++i; |
xhwang
2013/12/30 19:00:59
do we need to pending_infobar_requests_.erase(i) i
Kibeom Kim (inactive)
2013/12/30 21:52:24
When the infobar is removed, it's pending_infobar_
xhwang
2013/12/30 21:59:39
worth a comment?
Kibeom Kim (inactive)
2013/12/30 22:10:09
Done.
|
+ } else { |
+ i = pending_infobar_requests_.erase(i); |
+ } |
+ } else { |
+ ++i; |
+ } |
+ } |
+ |
+ for (PendingInfoBarRequests::iterator i = infobars_to_remove.begin(); |
+ i != infobars_to_remove.end(); |
+ ++i) { |
+ GetInfoBarService(i->id())->RemoveInfoBar(i->infobar()); |
+ } |
+} |
+ |
void PermissionQueueController::OnPermissionSet( |
const PermissionRequestID& id, |
const GURL& requesting_frame, |