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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 4222005: Turn on file access checks on Win. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Second try Created 10 years, 1 month 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/io_thread.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 64981)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -110,6 +110,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/glue/password_form.h"
+#include "webkit/glue/plugins/plugin_list.h"
// Cross-Site Navigations
//
@@ -2026,25 +2027,19 @@
DCHECK(!plugin_path.value().empty());
std::wstring plugin_name = plugin_path.ToWStringHack();
-#if defined(OS_WIN) || defined(OS_MACOSX)
- scoped_ptr<FileVersionInfo> version_info(
- FileVersionInfo::CreateFileVersionInfo(plugin_path));
- if (version_info.get()) {
- const std::wstring& product_name = version_info->product_name();
- if (!product_name.empty()) {
- plugin_name = product_name;
+ WebPluginInfo plugin_info;
+ if (NPAPI::PluginList::Singleton()->GetPluginInfoByPath(
+ plugin_path, &plugin_info) &&
+ !plugin_info.name.empty()) {
+ plugin_name = UTF16ToWide(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());
+ // 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";
-#endif
SkBitmap* crash_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_INFOBAR_PLUGIN_CRASHED);
AddInfoBar(new SimpleAlertInfoBarDelegate(
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698