Commit 4d11fcbf authored by clamy's avatar clamy Committed by Commit Bot

Remove usage of GetVisibleEntry [1/n]

This CL is part of a serie of CLs to remove usage of
Navigation::GetVisibleEntry when possible. Instead, we use
WebContents::GetVisibleURL or
NavigationController::GetLastCommittedEntry when appropriate.

Bug: 853705
Change-Id: I97ddfe4712fe68ff730ebc7ff1a6756094d3554d
Reviewed-on: https://chromium-review.googlesource.com/1104349Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568800}
parent 9a56b451
...@@ -759,15 +759,11 @@ void TabSpecificContentSettings::OnContentSettingChanged( ...@@ -759,15 +759,11 @@ void TabSpecificContentSettings::OnContentSettingChanged(
const std::string& resource_identifier) { const std::string& resource_identifier) {
const ContentSettingsDetails details( const ContentSettingsDetails details(
primary_pattern, secondary_pattern, content_type, resource_identifier); primary_pattern, secondary_pattern, content_type, resource_identifier);
const NavigationController& controller = web_contents()->GetController(); const GURL& visible_url = web_contents()->GetVisibleURL();
NavigationEntry* entry = controller.GetVisibleEntry();
GURL entry_url;
if (entry)
entry_url = entry->GetURL();
if (details.update_all() || if (details.update_all() ||
// The visible NavigationEntry is the URL in the URL field of a tab. // The visible URL is the URL in the URL field of a tab.
// Currently this should be matched by the |primary_pattern|. // Currently this should be matched by the |primary_pattern|.
details.primary_pattern().Matches(entry_url)) { details.primary_pattern().Matches(visible_url)) {
Profile* profile = Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext()); Profile::FromBrowserContext(web_contents()->GetBrowserContext());
const HostContentSettingsMap* map = const HostContentSettingsMap* map =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment