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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc

Issue 14670023: ChromeOS: Support opening files with apps from the downloads page. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: prioritize fallback handlers over non-default app handlers Created 7 years, 6 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/file_browser_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc
index 4aaaba614f0921916e8b011b085c2608e1fe9d06..d4dc24bd5d7837eb02deec671f23be7410cce461 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc
@@ -75,7 +75,6 @@
#include "grit/generated_resources.h"
#include "grit/platform_locale_settings.h"
#include "net/base/escape.h"
-#include "net/base/mime_util.h"
#include "net/base/network_change_notifier.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/shell_dialogs/selected_file_info.h"
@@ -395,23 +394,8 @@ void GetMimeTypesForFileURLs(const std::vector<base::FilePath>& file_paths,
PathAndMimeTypeSet* files) {
for (std::vector<base::FilePath>::const_iterator iter = file_paths.begin();
iter != file_paths.end(); ++iter) {
- const base::FilePath::StringType file_extension =
- StringToLowerASCII(iter->Extension());
-
- // TODO(thorogood): Rearchitect this call so it can run on the File thread;
- // GetMimeTypeFromFile requires this on Linux. Right now, we use
- // Chrome-level knowledge only.
- std::string mime_type;
- if (file_extension.empty() ||
- !net::GetWellKnownMimeTypeFromExtension(file_extension.substr(1),
- &mime_type)) {
- // If the file doesn't have an extension or its mime-type cannot be
- // determined, then indicate that it has the empty mime-type. This will
- // only be matched if the Web Intents accepts "*" or "*/*".
- files->insert(std::make_pair(*iter, ""));
- } else {
- files->insert(std::make_pair(*iter, mime_type));
- }
+ files->insert(
+ std::make_pair(*iter, file_manager_util::GetMimeTypeForPath(*iter)));
}
}

Powered by Google App Engine
This is Rietveld 408576698