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

Unified Diff: chrome/browser/extensions/tab_helper.cc

Issue 2668003004: Convert extensions::TabHelper to use the new navigation callbacks. (Closed)
Patch Set: update 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
Index: chrome/browser/extensions/tab_helper.cc
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
index 47188646c4587fa4f85439e0df17df69b4db1ef5..d2337d56af05b4918fd531ab898953bfbf73883a 100644
--- a/chrome/browser/extensions/tab_helper.cc
+++ b/chrome/browser/extensions/tab_helper.cc
@@ -40,8 +40,8 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/invalidate_type.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/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
@@ -316,12 +316,14 @@ void TabHelper::RenderFrameCreated(content::RenderFrameHost* host) {
SetTabId(host);
}
-void TabHelper::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
+void TabHelper::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
+ return;
+
InvokeForContentRulesRegistries(
- [this, &details, &params](ContentRulesRegistry* registry) {
- registry->DidNavigateMainFrame(web_contents(), details, params);
+ [this, navigation_handle](ContentRulesRegistry* registry) {
+ registry->DidFinishNavigation(web_contents(), navigation_handle);
});
content::BrowserContext* context = web_contents()->GetBrowserContext();
@@ -338,14 +340,15 @@ void TabHelper::DidNavigateMainFrame(
SetExtensionApp(extension);
} else {
UpdateExtensionAppIcon(
- enabled_extensions.GetExtensionOrAppByURL(params.url));
+ enabled_extensions.GetExtensionOrAppByURL(
+ navigation_handle->GetURL()));
}
} else {
UpdateExtensionAppIcon(
- enabled_extensions.GetExtensionOrAppByURL(params.url));
+ enabled_extensions.GetExtensionOrAppByURL(navigation_handle->GetURL()));
}
- if (!details.is_in_page)
+ if (!navigation_handle->IsSamePage())
ExtensionActionAPI::Get(context)->ClearAllValuesForTab(web_contents());
}
« no previous file with comments | « chrome/browser/extensions/tab_helper.h ('k') | extensions/browser/api/declarative_content/content_rules_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698