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

Unified Diff: chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc

Issue 2669643002: Convert PopupBlockerTabHelper to use the new navigation callbacks. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc b/chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc
index ab19dacc8ade5974e19db20d1cf346591455095a..76e0ce493b845132c6b95cafde96f0352983e89f 100644
--- a/chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc
+++ b/chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc
@@ -14,8 +14,8 @@
#include "chrome/common/render_messages.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
@@ -47,13 +47,16 @@ PopupBlockerTabHelper::PopupBlockerTabHelper(
PopupBlockerTabHelper::~PopupBlockerTabHelper() {
}
-void PopupBlockerTabHelper::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
+void PopupBlockerTabHelper::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
// Clear all page actions, blocked content notifications and browser actions
- // for this tab, unless this is an in-page navigation.
- if (details.is_in_page)
- return;
+ // for this tab, unless this is an in-page navigation. Also only consider
+ // main frame navigations that successfully committed.
+ if (!navigation_handle->IsInMainFrame() ||
+ !navigation_handle->HasCommitted() ||
+ navigation_handle->IsSamePage()) {
+ return;
+ }
// Close blocked popups.
if (!blocked_popups_.IsEmpty()) {
« no previous file with comments | « chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698