Chromium Code Reviews| 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..c251f031a57d4c3c00b7b406036846b5859bb235 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, ¶ms](ContentRulesRegistry* registry) { |
| - registry->DidNavigateMainFrame(web_contents(), details, params); |
| + [this, &navigation_handle](ContentRulesRegistry* registry) { |
|
Devlin
2017/02/01 23:18:22
nit: any reason to capture navigation_handle by re
jam
2017/02/01 23:48:49
no, you're right this was an oversight. thanks, fi
|
| + 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()); |
| } |