Commit f771d8d9 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[NativeFS] Possibly show usage indicators on about:blank.

Rather than figuring out the origin to show a indicator for from
WebContents::GetLastCommittedURL use RFH::GetLastCommittedOrigin.
This way about:blank pages will also show a usage indicator if their
origin has access to files/directories via the native file system API.

Bug: 106439
Change-Id: I8f25461adaec612852323045be0904ec75b575b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106888Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751841}
parent 5071ba66
...@@ -43,7 +43,7 @@ void NativeFileSystemAccessIconView::UpdateImpl() { ...@@ -43,7 +43,7 @@ void NativeFileSystemAccessIconView::UpdateImpl() {
has_write_access_ = false; has_write_access_ = false;
} else { } else {
url::Origin origin = url::Origin origin =
url::Origin::Create(GetWebContents()->GetLastCommittedURL()); GetWebContents()->GetMainFrame()->GetLastCommittedOrigin();
auto* context = auto* context =
NativeFileSystemPermissionContextFactory::GetForProfileIfExists( NativeFileSystemPermissionContextFactory::GetForProfileIfExists(
GetWebContents()->GetBrowserContext()); GetWebContents()->GetBrowserContext());
...@@ -80,10 +80,9 @@ NativeFileSystemAccessIconView::GetTextForTooltipAndAccessibleName() const { ...@@ -80,10 +80,9 @@ NativeFileSystemAccessIconView::GetTextForTooltipAndAccessibleName() const {
} }
void NativeFileSystemAccessIconView::OnExecuting(ExecuteSource execute_source) { void NativeFileSystemAccessIconView::OnExecuting(ExecuteSource execute_source) {
url::Origin origin =
url::Origin::Create(GetWebContents()->GetLastCommittedURL());
auto* web_contents = GetWebContents(); auto* web_contents = GetWebContents();
url::Origin origin = web_contents->GetMainFrame()->GetLastCommittedOrigin();
auto* context = auto* context =
NativeFileSystemPermissionContextFactory::GetForProfileIfExists( NativeFileSystemPermissionContextFactory::GetForProfileIfExists(
web_contents->GetBrowserContext()); web_contents->GetBrowserContext());
......
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