diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 16:49:40 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 16:49:40 +0000 |
commit | 0df165f0f1ea596434d547d9ef387a9fb486bb41 (patch) | |
tree | e1355837e7f0192e4584d4754427b008dbe513fc /chrome/browser/extensions/extension_install_ui.cc | |
parent | 6f2b3643bbe1a2cd290fc2e7d064837ec3c742d3 (diff) | |
download | chromium_src-0df165f0f1ea596434d547d9ef387a9fb486bb41.zip chromium_src-0df165f0f1ea596434d547d9ef387a9fb486bb41.tar.gz chromium_src-0df165f0f1ea596434d547d9ef387a9fb486bb41.tar.bz2 |
Generalize permission types to make it safer for us to add new permissions and to know that we're handling installation and elevation warnings correctly.
BUG=54151
BUG=54332
TEST=ExtensionTest.IsPrivilegeIncrease (and others)
Review URL: http://codereview.chromium.org/3307010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60803 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_install_ui.cc')
-rw-r--r-- | chrome/browser/extensions/extension_install_ui.cc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc index 0c5243b..91b4f44 100644 --- a/chrome/browser/extensions/extension_install_ui.cc +++ b/chrome/browser/extensions/extension_install_ui.cc @@ -78,7 +78,7 @@ static void GetV2Warnings(Extension* extension, return; } - if (extension->HasAccessToAllHosts()) { + if (extension->HasEffectiveAccessToAllHosts()) { warnings->push_back( l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT2_WARNING_ALL_HOSTS)); } else { @@ -110,27 +110,14 @@ static void GetV2Warnings(Extension* extension, } } - if (extension->HasEffectiveBrowsingHistoryPermission()) { - warnings->push_back( - l10n_util::GetStringUTF16( - IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY)); - } - - const Extension::SimplePermissions& simple_permissions = - Extension::GetSimplePermissions(); - - for (Extension::SimplePermissions::const_iterator iter = - simple_permissions.begin(); - iter != simple_permissions.end(); ++iter) { - if (extension->HasApiPermission(iter->first)) - warnings->push_back(iter->second); - } + std::set<string16> api_messages = extension->GetPermissionMessages(); + warnings->insert(warnings->end(), api_messages.begin(), api_messages.end()); } } // namespace std::vector<std::string> ExtensionInstallUI::GetDistinctHostsForDisplay( - const std::vector<URLPattern>& host_patterns) { + const URLPatternList& host_patterns) { // Vector because we later want to access these by index. std::vector<std::string> distinct_hosts; |