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

Unified Diff: chrome/browser/download/download_manager.cc

Issue 147017: Allow extension extensions to be case-insensitive. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « base/file_path_unittest.cc ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
===================================================================
--- chrome/browser/download/download_manager.cc (revision 19502)
+++ chrome/browser/download/download_manager.cc (working copy)
@@ -26,7 +26,6 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/tab_contents/tab_contents.h"
-#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/platform_util.h"
@@ -826,14 +825,8 @@
void DownloadManager::DownloadRenamedToFinalName(int download_id,
const FilePath& full_path) {
- FilePath::StringType extension = full_path.Extension();
- // Drop the leading period.
- if (extension.size() > 0)
- extension = extension.substr(1);
-
- if (extension == chrome::kExtensionFileExtension) {
+ if (Extension::IsExtension(full_path))
OpenChromeExtension(full_path);
- }
}
void DownloadManager::ContinueDownloadFinished(DownloadItem* download) {
@@ -849,12 +842,9 @@
// Open the download if the user or user prefs indicate it should be.
FilePath::StringType extension = download->full_path().Extension();
- // Drop the leading period.
- if (extension.size() > 0)
- extension = extension.substr(1);
// Handle chrome extensions explicitly and skip the shell execute.
- if (extension == chrome::kExtensionFileExtension) {
+ if (Extension::IsExtension(download->full_path())) {
// Skip the shell execute. This will be handled in
// DownloadRenamedToFinalName
return;
@@ -1218,14 +1208,9 @@
void DownloadManager::OpenDownload(const DownloadItem* download,
gfx::NativeView parent_window) {
- FilePath::StringType extension = download->full_path().Extension();
- // Drop the leading period.
- if (extension.size() > 0)
- extension = extension.substr(1);
-
// Open Chrome extensions with ExtensionsService. For everything else do shell
// execute.
- if (extension == chrome::kExtensionFileExtension) {
+ if (Extension::IsExtension(download->full_path())) {
OpenChromeExtension(download->full_path());
} else {
OpenDownloadInShell(download, parent_window);
@@ -1260,7 +1245,7 @@
// Special-case Chrome extensions as always-open.
if (!IsExecutable(extension) &&
(auto_open_.find(extension) != auto_open_.end() ||
- extension == chrome::kExtensionFileExtension))
+ Extension::IsExtension(FilePath(extension))))
return true;
return false;
}
@@ -1484,9 +1469,7 @@
// Extension downloading skips the shelf. This is a temporary fix until
// we can modularize the download system and develop specific extensiona
// install UI.
- FilePath::StringType extension = info.path.Extension();
- // Ignore the leading period.
- if (extension.find(chrome::kExtensionFileExtension) == 1)
+ if (Extension::IsExtension(info.path))
return;
// The 'contents' may no longer exist if the user closed the tab before we get
« no previous file with comments | « base/file_path_unittest.cc ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698