diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 17 | ||||
-rw-r--r-- | chrome/browser/greasemonkey_master.cc | 8 | ||||
-rw-r--r-- | chrome/browser/history/text_database_manager.cc | 7 | ||||
-rw-r--r-- | chrome/browser/importer/firefox2_importer.cc | 8 | ||||
-rw-r--r-- | chrome/browser/importer/ie_importer.cc | 9 | ||||
-rw-r--r-- | chrome/browser/printing/printing_layout_uitest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_database_unittest.cc | 5 | ||||
-rw-r--r-- | chrome/browser/user_data_manager.cc | 8 |
8 files changed, 37 insertions, 32 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index a536591..0245ce6 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -71,15 +71,14 @@ bool ExtensionsServiceBackend::LoadExtensionsFromDirectory( // Find all child directories in the install directory and load their // manifests. Post errors and results to the frontend. scoped_ptr<ExtensionList> extensions(new ExtensionList); - file_util::FileEnumerator enumerator(path.ToWStringHack(), + file_util::FileEnumerator enumerator(path, false, // not recursive file_util::FileEnumerator::DIRECTORIES); - for (std::wstring child_path = enumerator.Next(); !child_path.empty(); + for (FilePath child_path = enumerator.Next(); !child_path.value().empty(); child_path = enumerator.Next()) { - FilePath manifest_path = FilePath::FromWStringHack(child_path).Append( - Extension::kManifestFilename); + FilePath manifest_path = child_path.Append(Extension::kManifestFilename); if (!file_util::PathExists(manifest_path)) { - ReportExtensionLoadError(frontend.get(), child_path, + ReportExtensionLoadError(frontend.get(), child_path.ToWStringHack(), Extension::kInvalidManifestError); continue; } @@ -88,13 +87,14 @@ bool ExtensionsServiceBackend::LoadExtensionsFromDirectory( Value* root = NULL; std::string error; if (!serializer.Deserialize(&root, &error)) { - ReportExtensionLoadError(frontend.get(), child_path, error); + ReportExtensionLoadError(frontend.get(), child_path.ToWStringHack(), + error); continue; } scoped_ptr<Value> scoped_root(root); if (!root->IsType(Value::TYPE_DICTIONARY)) { - ReportExtensionLoadError(frontend.get(), child_path, + ReportExtensionLoadError(frontend.get(), child_path.ToWStringHack(), Extension::kInvalidManifestError); continue; } @@ -102,7 +102,8 @@ bool ExtensionsServiceBackend::LoadExtensionsFromDirectory( scoped_ptr<Extension> extension(new Extension()); if (!extension->InitFromValue(*static_cast<DictionaryValue*>(root), &error)) { - ReportExtensionLoadError(frontend.get(), child_path, error); + ReportExtensionLoadError(frontend.get(), child_path.ToWStringHack(), + error); continue; } diff --git a/chrome/browser/greasemonkey_master.cc b/chrome/browser/greasemonkey_master.cc index bb9e1a3..560f695 100644 --- a/chrome/browser/greasemonkey_master.cc +++ b/chrome/browser/greasemonkey_master.cc @@ -113,12 +113,12 @@ base::SharedMemory* GreasemonkeyMaster::ScriptReloader::GetNewScripts( const FilePath& script_dir) { std::vector<std::wstring> scripts; - file_util::FileEnumerator enumerator(script_dir.value(), false, + file_util::FileEnumerator enumerator(script_dir, false, file_util::FileEnumerator::FILES, - L"*.user.js"); - for (std::wstring file = enumerator.Next(); !file.empty(); + FILE_PATH_LITERAL("*.user.js")); + for (FilePath file = enumerator.Next(); !file.value().empty(); file = enumerator.Next()) { - scripts.push_back(file); + scripts.push_back(file.ToWStringHack()); } if (scripts.empty()) diff --git a/chrome/browser/history/text_database_manager.cc b/chrome/browser/history/text_database_manager.cc index ed280fe..12ba716 100644 --- a/chrome/browser/history/text_database_manager.cc +++ b/chrome/browser/history/text_database_manager.cc @@ -147,11 +147,12 @@ void TextDatabaseManager::InitDBList() { present_databases_loaded_ = true; // Find files on disk matching our pattern so we can quickly test for them. - file_util::FileEnumerator enumerator(dir_, false, + file_util::FileEnumerator enumerator(FilePath::FromWStringHack(dir_), false, file_util::FileEnumerator::FILES, - std::wstring(TextDatabase::file_base()) + L"*"); + FilePath::FromWStringHack( + std::wstring(TextDatabase::file_base()) + L"*").value()); std::wstring cur_file; - while (!(cur_file = enumerator.Next()).empty()) { + while (!(cur_file = enumerator.Next().ToWStringHack()).empty()) { // Convert to the number representing this file. TextDatabase::DBIdent id = TextDatabase::FileNameToID(cur_file); if (id) // Will be 0 on error. diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index aef2ba2..88da065 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -508,13 +508,13 @@ void Firefox2Importer::HTMLUnescape(std::wstring *text) { void Firefox2Importer::FindXMLFilesInDir( const std::wstring& dir, std::vector<std::wstring>* xml_files) { - file_util::FileEnumerator file_enum(dir, false, + file_util::FileEnumerator file_enum(FilePath::FromWStringHack(dir), false, file_util::FileEnumerator::FILES, - L"*.xml"); - std::wstring file(file_enum.Next()); + FILE_PATH_LITERAL("*.xml")); + std::wstring file(file_enum.Next().ToWStringHack()); while (!file.empty()) { xml_files->push_back(file); - file = file_enum.Next(); + file = file_enum.Next().ToWStringHack(); } } diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc index b171a9c..429b786 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -469,12 +469,13 @@ void IEImporter::ParseFavoritesFolder(const FavoritesInfo& info, BookmarkVector* bookmarks) { std::wstring ie_folder = l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_IE); BookmarkVector toolbar_bookmarks; - std::wstring file; + FilePath file; std::vector<std::wstring> file_list; - file_util::FileEnumerator file_enumerator(info.path, true, + file_util::FileEnumerator file_enumerator( + FilePath::FromWStringHack(info.path), true, file_util::FileEnumerator::FILES); - while (!(file = file_enumerator.Next()).empty() && !cancelled()) - file_list.push_back(file); + while (!(file = file_enumerator.Next()).value().empty() && !cancelled()) + file_list.push_back(file.ToWStringHack()); // Keep the bookmarks in alphabetical order. std::sort(file_list.begin(), file_list.end()); diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc index 213e199..8a15aa4 100644 --- a/chrome/browser/printing/printing_layout_uitest.cc +++ b/chrome/browser/printing/printing_layout_uitest.cc @@ -332,14 +332,15 @@ class PrintingLayoutTest : public PrintingTest<UITest> { bool found_emf = false; bool found_prn = false; for (int i = 0; i < 100; ++i) { - file_util::FileEnumerator enumerator(emf_path(), false, - file_util::FileEnumerator::FILES); + file_util::FileEnumerator enumerator( + FilePath::FromWStringHack(emf_path()), false, + file_util::FileEnumerator::FILES); emf_file.clear(); prn_file.clear(); found_emf = false; found_prn = false; std::wstring file; - while (!(file = enumerator.Next()).empty()) { + while (!(file = enumerator.Next().ToWStringHack()).empty()) { std::wstring ext = file_util::GetFileExtensionFromPath(file); if (!_wcsicmp(ext.c_str(), L"emf")) { EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc index 4fa984d..7706a59 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc @@ -1114,9 +1114,10 @@ void UpdateDatabase(const std::wstring& initial_db, if (!updates_path.empty()) { std::wstring data_dir = GetFullSBDataPath(updates_path); file_util::FileEnumerator file_enum( - data_dir, false, file_util::FileEnumerator::FILES); + FilePath::FromWStringHack(data_dir), false, + file_util::FileEnumerator::FILES); while (true) { - std::wstring file = file_enum.Next(); + std::wstring file = file_enum.Next().ToWStringHack(); if (file.empty()) break; diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc index 33bdf00..3353016 100644 --- a/chrome/browser/user_data_manager.cc +++ b/chrome/browser/user_data_manager.cc @@ -205,11 +205,11 @@ void UserDataManager::GetProfiles(std::vector<std::wstring>* profiles) const { // This function should be called on the file thread. DCHECK(MessageLoop::current() == ChromeThread::GetMessageLoop(ChromeThread::FILE)); - file_util::FileEnumerator file_enum(user_data_root_, - false, - file_util::FileEnumerator::DIRECTORIES); + file_util::FileEnumerator file_enum( + FilePath::FromWStringHack(user_data_root_), + false, file_util::FileEnumerator::DIRECTORIES); std::wstring folder_name; - while (!(folder_name = file_enum.Next()).empty()) { + while (!(folder_name = file_enum.Next().ToWStringHack()).empty()) { folder_name = file_util::GetFilenameFromPath(folder_name); std::wstring profile_name; if (GetProfileNameFromFolderName(folder_name, &profile_name)) |