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

Unified Diff: chrome/common/extensions/manifest_handlers/automation.cc

Issue 410023002: Show read-only messages for non-interact non-desktop Automation extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 6 years, 5 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
Index: chrome/common/extensions/manifest_handlers/automation.cc
diff --git a/chrome/common/extensions/manifest_handlers/automation.cc b/chrome/common/extensions/manifest_handlers/automation.cc
index f6945ed6cdb81945641751bcdc501dafce41caa9..aed16c4dfbaed34ea6c99bc132cfc10fe1147130 100644
--- a/chrome/common/extensions/manifest_handlers/automation.cc
+++ b/chrome/common/extensions/manifest_handlers/automation.cc
@@ -88,9 +88,16 @@ PermissionMessages AutomationManifestPermission::GetMessages() const {
PermissionMessage::kFullAccess,
l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS)));
} else if (automation_info_->matches.MatchesAllURLs()) {
- messages.push_back(PermissionMessage(
- PermissionMessage::kHostsAll,
- l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS)));
+ if (automation_info_->interact) {
+ messages.push_back(PermissionMessage(
+ PermissionMessage::kHostsAll,
+ l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS)));
+ } else {
+ messages.push_back(PermissionMessage(
+ PermissionMessage::kHostsAllReadOnly,
+ l10n_util::GetStringUTF16(
+ IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS_READ_ONLY)));
+ }
} else {
URLPatternSet regular_hosts;
std::set<PermissionMessage> message_set;
@@ -100,8 +107,10 @@ PermissionMessages AutomationManifestPermission::GetMessages() const {
std::set<std::string> hosts =
permission_message_util::GetDistinctHosts(regular_hosts, true, true);
- if (!hosts.empty())
- messages.push_back(permission_message_util::CreateFromHostList(hosts));
+ if (!hosts.empty()) {
+ messages.push_back(permission_message_util::CreateFromHostList(
+ hosts, !automation_info_->interact));
+ }
}
return messages;

Powered by Google App Engine
This is Rietveld 408576698