diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-03 07:03:34 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-03 07:03:34 +0000 |
commit | c5c3c5b5f3b11fcef3d3b89d5be656ff4794de89 (patch) | |
tree | b9d3a0b11006b33bd20f1ce116f23a07e8186526 /chrome/browser/extensions | |
parent | e0d92f287e9f793f3980286c5eeabb3fff59b2c3 (diff) | |
download | chromium_src-c5c3c5b5f3b11fcef3d3b89d5be656ff4794de89.zip chromium_src-c5c3c5b5f3b11fcef3d3b89d5be656ff4794de89.tar.gz chromium_src-c5c3c5b5f3b11fcef3d3b89d5be656ff4794de89.tar.bz2 |
Add the new extension install dialog for mac.
There are two xibs in this change.
ExtensionInstallPrompt.xib: This handles the more common case of installing an extension with one or more permission warnings. There is an NSBox with room for the warnings which are separated by \n\n.
ExtensionInstallPromptNoWarnings.xib: It is also possible to install an extension with zero permission warnings. This is currently rare, but we hope to make it more common in the coming quarters. In this case, there is no NSBox and the layout is slightly different.
BUG=29633
Review URL: http://codereview.chromium.org/1540013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_install_ui.cc | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc index a40ae58..76eacdd 100644 --- a/chrome/browser/extensions/extension_install_ui.cc +++ b/chrome/browser/extensions/extension_install_ui.cc @@ -82,56 +82,6 @@ static bool ExtensionHasFileAccess(Extension* extension) { return false; } -// TODO(estade): remove this function when the old install UI is removed. It -// is commented out on linux/gtk due to compiler warnings. -#if !defined(TOOLKIT_GTK) -static std::wstring GetInstallWarning(Extension* extension) { - // If the extension has a plugin, it's easy: the plugin has the most severe - // warning. - if (!extension->plugins().empty() || ExtensionHasFileAccess(extension)) - return l10n_util::GetString(IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS); - - // Otherwise, we go in descending order of severity: all hosts, several hosts, - // a single host, no hosts. For each of these, we also have a variation of the - // message for when api permissions are also requested. - if (extension->HasAccessToAllHosts()) { - if (!extension->HasEffectiveBrowsingHistoryPermission()) - return l10n_util::GetString(IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS); - else - return l10n_util::GetString( - IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS_AND_BROWSER); - } - - const std::set<std::string> hosts = extension->GetEffectiveHostPermissions(); - if (hosts.size() > 1) { - if (!extension->HasEffectiveBrowsingHistoryPermission()) - return l10n_util::GetString( - IDS_EXTENSION_PROMPT_WARNING_MULTIPLE_HOSTS); - else - return l10n_util::GetString( - IDS_EXTENSION_PROMPT_WARNING_MULTIPLE_HOSTS_AND_BROWSER); - } - - if (hosts.size() == 1) { - if (!extension->HasEffectiveBrowsingHistoryPermission()) - return l10n_util::GetStringF( - IDS_EXTENSION_PROMPT_WARNING_SINGLE_HOST, - UTF8ToWide(*hosts.begin())); - else - return l10n_util::GetStringF( - IDS_EXTENSION_PROMPT_WARNING_SINGLE_HOST_AND_BROWSER, - UTF8ToWide(*hosts.begin())); - } - - DCHECK(hosts.size() == 0); - if (!extension->HasEffectiveBrowsingHistoryPermission()) - return L""; - else - return l10n_util::GetString(IDS_EXTENSION_PROMPT_WARNING_BROWSER); -} -#endif - -#if defined(OS_WIN) || defined(TOOLKIT_GTK) static void GetV2Warnings(Extension* extension, std::vector<string16>* warnings) { if (!extension->plugins().empty() || ExtensionHasFileAccess(extension)) { @@ -180,7 +130,6 @@ static void GetV2Warnings(Extension* extension, // TODO(aa): Geolocation, camera/mic, what else? } -#endif } // namespace @@ -314,16 +263,10 @@ void ExtensionInstallUI::OnImageLoaded( Source<ExtensionInstallUI>(this), NotificationService::NoDetails()); -#if defined(OS_WIN) || defined(TOOLKIT_GTK) std::vector<string16> warnings; GetV2Warnings(extension_, &warnings); ShowExtensionInstallUIPrompt2Impl( profile_, delegate_, extension_, &icon_, warnings); -#else - ShowExtensionInstallUIPromptImpl( - profile_, delegate_, extension_, &icon_, - WideToUTF16Hack(GetInstallWarning(extension_)), INSTALL_PROMPT); -#endif break; } case UNINSTALL_PROMPT: { |