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

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, 1 month 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 c5b24af0d04b9d5c99fe6b3b631b90ddf72c152d..10287fb1258c800e6616eee93205aa5c925e7667 100644
--- a/chrome/common/extensions/manifest_handlers/automation.cc
+++ b/chrome/common/extensions/manifest_handlers/automation.cc
@@ -85,9 +85,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;
@@ -97,8 +104,12 @@ 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 ? permission_message_util::kReadWrite
+ : permission_message_util::kReadOnly));
+ }
}
return messages;
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/common/extensions/manifest_handlers/automation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698