summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 19:12:37 +0000
committerstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 19:12:37 +0000
commit996fd703fb7229e931203edc77df436aea9bc9a5 (patch)
treee52458f9e43ec4762ce58c3b15a235ad31e3d667 /chrome
parentf62a8906648ddfcee0ffa9604939d4c7f66891aa (diff)
downloadchromium_src-996fd703fb7229e931203edc77df436aea9bc9a5.zip
chromium_src-996fd703fb7229e931203edc77df436aea9bc9a5.tar.gz
chromium_src-996fd703fb7229e931203edc77df436aea9bc9a5.tar.bz2
Strip .plugin off of Mac plugin names when showing the crash info bar.
BUG=21029 TEST=Kill a plugin process; the plugin crash info bar shouldn't have ".plugin" in the plugin name. Review URL: http://codereview.chromium.org/197018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 083296c..c76b733 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -9,6 +9,7 @@
#include "base/file_version_info.h"
#include "base/process_util.h"
#include "base/string16.h"
+#include "base/string_util.h"
#include "base/time.h"
#include "chrome/browser/autofill_manager.h"
#include "chrome/browser/blocked_popup_container.h"
@@ -1657,8 +1658,16 @@ void TabContents::OnCrashedPlugin(const FilePath& plugin_path) {
FileVersionInfo::CreateFileVersionInfo(plugin_path));
if (version_info.get()) {
const std::wstring& product_name = version_info->product_name();
- if (!product_name.empty())
+ if (!product_name.empty()) {
plugin_name = product_name;
+#if defined(OS_MACOSX)
+ // Many plugins on the Mac have .plugin in the actual name, which looks
+ // terrible, so look for that and strip it off if present.
+ const std::wstring plugin_extension(L".plugin");
+ if (EndsWith(plugin_name, plugin_extension, true))
+ plugin_name.erase(plugin_name.length() - plugin_extension.length());
+#endif // OS_MACOSX
+ }
}
#else
NOTIMPLEMENTED() << " convert plugin path to plugin name";