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

Unified Diff: chrome/browser/enumerate_modules_model_win.cc

Issue 6386009: Remove app/win/win_util.h,cc etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with NSApp changes in r73581 Created 9 years, 11 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/download/download_util.cc ('k') | chrome/browser/extensions/extensions_startup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/enumerate_modules_model_win.cc
diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc
index acfed882bcbab64c6112d5597d1c9b87f1ba2b11..bd2cc51a8ed5e18af1aba1685d8f24f7709ede6f 100644
--- a/chrome/browser/enumerate_modules_model_win.cc
+++ b/chrome/browser/enumerate_modules_model_win.cc
@@ -7,7 +7,6 @@
#include <Tlhelp32.h>
#include <wintrust.h>
-#include "app/win/win_util.h"
#include "base/command_line.h"
#include "base/environment.h"
#include "base/file_path.h"
@@ -75,8 +74,23 @@ struct FindModule {
const ModuleEnumerator::Module& module;
};
+// Returns the long path name given a short path name. A short path name is a
+// path that follows the 8.3 convention and has ~x in it. If the path is already
+// a long path name, the function returns the current path without modification.
+bool ConvertToLongPath(const string16& short_path, string16* long_path) {
+ wchar_t long_path_buf[MAX_PATH];
+ DWORD return_value = GetLongPathName(short_path.c_str(), long_path_buf,
+ MAX_PATH);
+ if (return_value != 0 && return_value < MAX_PATH) {
+ *long_path = long_path_buf;
+ return true;
+ }
+
+ return false;
}
+} // namespace
+
// The browser process module blacklist. This lists modules that are known
// to cause compatibility issues within the browser process. When adding to this
// list, make sure that all paths are lower-case, in long pathname form, end
@@ -220,7 +234,7 @@ static void GenerateHash(const std::string& input, std::string* output) {
// static
void ModuleEnumerator::NormalizeModule(Module* module) {
string16 path = module->location;
- if (!app::win::ConvertToLongPath(path, &module->location))
+ if (!ConvertToLongPath(path, &module->location))
module->location = path;
module->location = l10n_util::ToLower(module->location);
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | chrome/browser/extensions/extensions_startup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698