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

Unified Diff: chrome/browser/chromeos/extensions/file_manager_util.cc

Issue 9594037: Revert 124975 - [filebrowser] Introduce "Open" action for supported file types (e.g. pdf). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/chromeos/extensions/file_manager_util.cc
===================================================================
--- chrome/browser/chromeos/extensions/file_manager_util.cc (revision 125001)
+++ chrome/browser/chromeos/extensions/file_manager_util.cc (working copy)
@@ -122,6 +122,29 @@
return base::strcasecmp(file_extension, kCRXExtension) == 0;
}
+// If pdf plugin is enabled, we should open pdf files in a tab.
+bool ShouldBeOpenedWithPdfPlugin(const char* file_extension) {
+ if (base::strcasecmp(file_extension, kPdfExtension) != 0)
+ return false;
+
+ Browser* browser = BrowserList::GetLastActive();
+ if (!browser)
+ return false;
+
+ FilePath pdf_path;
+ PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path);
+
+ webkit::WebPluginInfo plugin;
+ if (!PluginService::GetInstance()->GetPluginInfoByPath(pdf_path, &plugin))
+ return false;
+
+ PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile());
+ if (!plugin_prefs)
+ return false;
+
+ return plugin_prefs->IsPluginEnabled(plugin);
+}
+
// Returns index |ext| has in the |array|. If there is no |ext| in |array|, last
// element's index is return (last element should have irrelevant value).
int UMAExtensionIndex(const char *file_extension,
@@ -445,27 +468,4 @@
installer->InstallCrx(full_path);
}
-// If pdf plugin is enabled, we should open pdf files in a tab.
-bool ShouldBeOpenedWithPdfPlugin(const char* file_extension) {
- if (base::strcasecmp(file_extension, kPdfExtension) != 0)
- return false;
-
- Browser* browser = BrowserList::GetLastActive();
- if (!browser)
- return false;
-
- FilePath pdf_path;
- PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path);
-
- webkit::WebPluginInfo plugin;
- if (!PluginService::GetInstance()->GetPluginInfoByPath(pdf_path, &plugin))
- return false;
-
- PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile());
- if (!plugin_prefs)
- return false;
-
- return plugin_prefs->IsPluginEnabled(plugin);
-}
-
} // namespace file_manager_util
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager_util.h ('k') | chrome/browser/resources/file_manager/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698