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

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: retry 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
Index: chrome/browser/plugin_observer.cc
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index 529f21e3fecbc38bdd6389e10bbb777043911ea9..53b1da15dfd506b2e0d638a22feaab4c73cb3987 100644
--- a/chrome/browser/plugin_observer.cc
+++ b/chrome/browser/plugin_observer.cc
@@ -258,17 +258,17 @@ 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))
+ const char* kPluginExtension = ".plugin";
+ if (EndsWith(plugin_name, ASCIIToUTF16(plugin_extension), true))
plugin_name.erase(plugin_name.length() - plugin_extension.length());
#endif // OS_MACOSX
}
@@ -276,8 +276,8 @@ void PluginObserver::OnCrashedPlugin(const FilePath& plugin_path) {
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,

Powered by Google App Engine
This is Rietveld 408576698