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

Unified Diff: chrome/browser/ui/webui/extensions/install_extension_handler.cc

Issue 1129103006: Converting file_display_name_ type from base::string16 to base::FilePath. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « chrome/browser/ui/webui/extensions/install_extension_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/extensions/install_extension_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/install_extension_handler.cc b/chrome/browser/ui/webui/extensions/install_extension_handler.cc
index 002cebd6f9d6060c7e9d54a48a0af8f71482aafb..fa6a977756bd0ea9203f5a2f69da1da0f4db7144 100644
--- a/chrome/browser/ui/webui/extensions/install_extension_handler.cc
+++ b/chrome/browser/ui/webui/extensions/install_extension_handler.cc
@@ -79,10 +79,8 @@ void InstallExtensionHandler::HandleStartDragMessage(
file_to_install_ = file_info.path;
// Use the display name if provided, for checking file names
// (.path is likely a random hash value in that case).
- // TODO(dcheng): It would be nice to make this a FilePath too.
not at google - send to devlin 2015/05/11 18:06:07 I don't understand this TODO and disagree with thi
- file_display_name_ = file_info.display_name.empty()
- ? file_info.path.AsUTF16Unsafe()
- : file_info.display_name.AsUTF16Unsafe();
+ file_display_name_ =
+ file_info.display_name.empty() ? file_info.path : file_info.display_name;
}
void InstallExtensionHandler::HandleStopDragMessage(
@@ -103,8 +101,8 @@ void InstallExtensionHandler::HandleInstallMessage(
const bool kCaseSensitive = false;
- if (EndsWith(
- file_display_name_, base::ASCIIToUTF16(".zip"), kCaseSensitive)) {
+ if (EndsWith(file_display_name_.AsUTF16Unsafe(), base::ASCIIToUTF16(".zip"),
dcheng 2015/05/11 18:16:15 Why not FilePath::MatchesExtension()? That being
not at google - send to devlin 2015/05/11 18:28:32 Using MatchesExtension would make this change much
Deepak 2015/05/12 05:41:58 I agree with you, Anyways kCaseSensitive value is
+ kCaseSensitive)) {
ZipFileInstaller::Create(ExtensionSystem::Get(profile)->extension_service())
->LoadFromZipFile(file_to_install_);
} else {
@@ -117,14 +115,12 @@ void InstallExtensionHandler::HandleInstallMessage(
CrxInstaller::OffStoreInstallAllowedFromSettingsPage);
crx_installer->set_install_immediately(true);
- if (EndsWith(file_display_name_,
- base::ASCIIToUTF16(".user.js"),
- kCaseSensitive)) {
+ if (EndsWith(file_display_name_.AsUTF16Unsafe(),
+ base::ASCIIToUTF16(".user.js"), kCaseSensitive)) {
crx_installer->InstallUserScript(
file_to_install_, net::FilePathToFileURL(file_to_install_));
- } else if (EndsWith(file_display_name_,
- base::ASCIIToUTF16(".crx"),
- kCaseSensitive)) {
+ } else if (EndsWith(file_display_name_.AsUTF16Unsafe(),
+ base::ASCIIToUTF16(".crx"), kCaseSensitive)) {
crx_installer->InstallCrx(file_to_install_);
} else {
CHECK(false);
« no previous file with comments | « chrome/browser/ui/webui/extensions/install_extension_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698