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

Unified Diff: chrome/browser/plugin_observer.cc

Issue 6246036: FilePath: Remove most of ToWStringHack, adding a LossyDisplayName() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bug link Created 9 years, 11 months 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
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/plugin_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_observer.cc
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index 529f21e3fecbc38bdd6389e10bbb777043911ea9..183218c19c08f5843f8821954ad6816dbfe4c4b1 100644
--- a/chrome/browser/plugin_observer.cc
+++ b/chrome/browser/plugin_observer.cc
@@ -258,26 +258,26 @@ void PluginObserver::OnMissingPluginStatus(int status) {
void PluginObserver::OnCrashedPlugin(const FilePath& plugin_path) {
DCHECK(!plugin_path.value().empty());
- std::wstring plugin_name = plugin_path.ToWStringHack();
+ string16 plugin_name = plugin_path.LossyDisplayName();
webkit::npapi::WebPluginInfo plugin_info;
if (webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath(
plugin_path, &plugin_info) &&
!plugin_info.name.empty()) {
- plugin_name = UTF16ToWide(plugin_info.name);
+ plugin_name = plugin_info.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());
+ const string kPluginExtension = ".plugin";
+ if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true))
+ plugin_name.erase(plugin_name.length() - kPluginExtension.length());
#endif // OS_MACOSX
}
SkBitmap* crash_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_INFOBAR_PLUGIN_CRASHED);
tab_contents_->AddInfoBar(new SimpleAlertInfoBarDelegate(
tab_contents_, crash_icon,
- l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT,
- WideToUTF16Hack(plugin_name)), true));
+ l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT, plugin_name),
+ true));
}
void PluginObserver::OnBlockedOutdatedPlugin(const string16& name,
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/plugin_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698