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

Unified Diff: chrome/browser/content_settings/permission_queue_controller.cc

Issue 107413006: Dismiss EME infobar when WebMediaPlayer is destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Version2: added group_id to PermissionRequestID class Created 7 years 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/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,

Powered by Google App Engine
This is Rietveld 408576698