diff --git a/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_EXTENSION_LIST_SEPARATOR.png.sha1 b/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_EXTENSION_LIST_SEPARATOR.png.sha1 index 6ee6d61a3e4afe..4a1988adad51e2 100644 --- a/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_EXTENSION_LIST_SEPARATOR.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_EXTENSION_LIST_SEPARATOR.png.sha1 @@ -1 +1 @@ -aa286efbaee111ce1a8e37854ff384fa397f929e \ No newline at end of file +8d581b03984765654d656d238290675b9293c282 \ No newline at end of file diff --git a/chrome/browser/content_settings/chrome_content_settings_utils.cc b/chrome/browser/content_settings/chrome_content_settings_utils.cc index dace9ca84354ae..46ed25af51424c 100644 --- a/chrome/browser/content_settings/chrome_content_settings_utils.cc +++ b/chrome/browser/content_settings/chrome_content_settings_utils.cc @@ -12,6 +12,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/location_bar/location_bar.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/web_applications/components/web_app_utils.h" #include "content/public/browser/web_contents.h" #endif @@ -42,4 +43,15 @@ void UpdateLocationBarUiForWebContents(content::WebContents* web_contents) { #endif } +#if !defined(OS_ANDROID) +std::u16string GetPermissionDetailString(Profile* profile, + ContentSettingsType content_type, + const GURL& url) { + if (content_type != ContentSettingsType::FILE_HANDLING || !url.is_valid()) + return {}; + + return web_app::GetFileExtensionsHandledByWebAppDisplayedAsList(profile, url); +} +#endif + } // namespace content_settings diff --git a/chrome/browser/content_settings/chrome_content_settings_utils.h b/chrome/browser/content_settings/chrome_content_settings_utils.h index e01e28581a3beb..3347fa78675418 100644 --- a/chrome/browser/content_settings/chrome_content_settings_utils.h +++ b/chrome/browser/content_settings/chrome_content_settings_utils.h @@ -6,11 +6,16 @@ #define CHROME_BROWSER_CONTENT_SETTINGS_CHROME_CONTENT_SETTINGS_UTILS_H_ #include "build/build_config.h" +#include "components/content_settings/core/common/content_settings.h" // Put utility functions only used by //chrome code here. If a function declared // here would be meaningfully shared with other platforms, consider moving it to // components/content_settings/core/browser/content_settings_utils.h. +class GURL; +class Profile; +enum class ContentSettingsType; + namespace content { class WebContents; } // namespace content @@ -51,6 +56,16 @@ void RecordPopupsAction(PopupsAction action); // Calls UpdateContentSettingsIcons on the |LocationBar| for |web_contents|. void UpdateLocationBarUiForWebContents(content::WebContents* web_contents); +#if !defined(OS_ANDROID) +// Returns a string for display alongside UI that describes the given content +// setting in `profile`. This string gives extra, pertinent details about the +// content setting. `url` represents the site for which the given setting +// applies. +std::u16string GetPermissionDetailString(Profile* profile, + ContentSettingsType content_type, + const GURL& url); +#endif + } // namespace content_settings #endif // CHROME_BROWSER_CONTENT_SETTINGS_CHROME_CONTENT_SETTINGS_UTILS_H_ diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.html b/chrome/browser/resources/settings/site_settings/site_details_permission.html index ea9cb5776096ba..6d18d7ae23caf8 100644 --- a/chrome/browser/resources/settings/site_settings/site_details_permission.html +++ b/chrome/browser/resources/settings/site_settings/site_details_permission.html @@ -1,8 +1,10 @@
+ class$="list-item [[permissionInfoStringClass_(site.source, + category, + site.setting, + site.settingDetail)]]">
@@ -10,12 +12,15 @@