Chromium Code Reviews| Index: chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| diff --git a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| index a091606ac8e2d05d3f0ff3aa3cf369c279889146..284ee702daa8951dca579b0473a4b0d142ff74e9 100644 |
| --- a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| +++ b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| @@ -80,6 +80,14 @@ ChromePermissionMessageProvider::~ChromePermissionMessageProvider() { |
| PermissionMessages ChromePermissionMessageProvider::GetPermissionMessages( |
| const PermissionSet* permissions, |
| Manifest::Type extension_type) const { |
| + PermissionMessages messages; |
| + if (permissions->HasEffectiveFullAccess()) { |
|
not at google - send to devlin
2014/08/18 22:59:42
Why did you need to move this up?
meacer
2014/08/18 23:11:07
Early return. The suppress list isn't needed if we
not at google - send to devlin
2014/08/18 23:17:30
Ah right. Full as in ***FULL*** not like all-urls.
meacer
2014/08/18 23:31:13
That looks like a bug to me with the automation AP
|
| + messages.push_back(PermissionMessage( |
| + PermissionMessage::kFullAccess, |
| + l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS))); |
| + return messages; |
| + } |
| + |
| // Some warnings are more generic and/or powerful and superseed other |
| // warnings. In that case, the first message suppresses the second one. |
| std::multimap<PermissionMessage::ID, PermissionMessage::ID> kSuppressList; |
| @@ -93,6 +101,9 @@ PermissionMessages ChromePermissionMessageProvider::GetPermissionMessages( |
| // History already allows tabs access. |
| kSuppressList.insert( |
| {PermissionMessage::kBrowsingHistory, PermissionMessage::kTabs}); |
| + // History already allows access the list of most frequently visited sites. |
| + kSuppressList.insert( |
| + {PermissionMessage::kBrowsingHistory, PermissionMessage::kTopSites}); |
| // A special hack: If kFileSystemWriteDirectory would be displayed, hide |
| // kFileSystemDirectory as the write directory message implies it. |
| // TODO(sammc): Remove this. See http://crbug.com/284849. |
| @@ -101,20 +112,17 @@ PermissionMessages ChromePermissionMessageProvider::GetPermissionMessages( |
| // Full access already allows DeclarativeWebRequest. |
| kSuppressList.insert({PermissionMessage::kHostsAll, |
| PermissionMessage::kDeclarativeWebRequest}); |
| + // Full access implies reading the list of most frequently visited sites. |
| + kSuppressList.insert( |
| + {PermissionMessage::kHostsAll, PermissionMessage::kTopSites}); |
| // Full access already covers tabs access. |
| kSuppressList.insert( |
| {PermissionMessage::kHostsAll, PermissionMessage::kTabs}); |
| // Tabs already allows reading favicons. |
| kSuppressList.insert({PermissionMessage::kTabs, PermissionMessage::kFavicon}); |
| - |
| - PermissionMessages messages; |
| - |
| - if (permissions->HasEffectiveFullAccess()) { |
| - messages.push_back(PermissionMessage( |
| - PermissionMessage::kFullAccess, |
| - l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS))); |
| - return messages; |
| - } |
| + // Tabs already allows reading the list of most frequently visited sites. |
| + kSuppressList.insert( |
| + {PermissionMessage::kTabs, PermissionMessage::kTopSites}); |
| PermissionMsgSet host_msgs = |
| GetHostPermissionMessages(permissions, extension_type); |