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

Unified Diff: chrome/browser/ui/website_settings/website_settings.cc

Issue 2726853007: Views/Permissions: Update desktop UI to display BLOCK for embargoed permissions. (Closed)
Patch Set: Review comments. Created 3 years, 9 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
« no previous file with comments | « chrome/browser/permissions/permission_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/website_settings/website_settings.cc
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc
index a8549dddb7e8f68511f29b23c857127dbecb6272..22355f48a4147c9b0078da9d8d72c39b47e6475d 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -32,6 +32,8 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/permissions/chooser_context_base.h"
+#include "chrome/browser/permissions/permission_manager.h"
+#include "chrome/browser/permissions/permission_result.h"
#include "chrome/browser/permissions/permission_uma_util.h"
#include "chrome/browser/permissions/permission_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -674,6 +676,24 @@ void WebsiteSettings::PresentSitePermissions() {
NULL);
}
+ // For permissions that are still prompting the user and haven't been
+ // explicitly set by another source, check its embargo status.
+ if (PermissionUtil::IsPermission(permission_info.type) &&
+ permission_info.setting == CONTENT_SETTING_DEFAULT &&
+ permission_info.source ==
+ content_settings::SettingSource::SETTING_SOURCE_USER) {
+ // TODO(raymes): Use GetPermissionStatus() to retrieve information
+ // about *all* permissions once it has default behaviour implemented for
+ // ContentSettingTypes that aren't permissions.
+ PermissionResult permission_result =
+ PermissionManager::Get(profile_)->GetPermissionStatus(
+ permission_info.type, site_url_, site_url_);
+
+ // If under embargo, update |permission_info| to reflect that.
+ if (permission_result.content_setting == CONTENT_SETTING_BLOCK)
raymes 2017/03/06 23:06:52 I think there are some reasons for correctness to
Patti Lor 2017/03/07 06:31:28 Done.
+ permission_info.setting = permission_result.content_setting;
+ }
+
permission_info_list.push_back(permission_info);
}
« no previous file with comments | « chrome/browser/permissions/permission_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698