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

Side by Side Diff: ui/shell_dialogs/select_file_dialog_win.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/shell_dialogs/select_file_dialog_win.h" 5 #include "ui/shell_dialogs/select_file_dialog_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <commdlg.h> 8 #include <commdlg.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return metro_get_save_file_name(ofn) == TRUE; 79 return metro_get_save_file_name(ofn) == TRUE;
80 } else { 80 } else {
81 return GetSaveFileName(ofn) == TRUE; 81 return GetSaveFileName(ofn) == TRUE;
82 } 82 }
83 } 83 }
84 84
85 // Distinguish directories from regular files. 85 // Distinguish directories from regular files.
86 bool IsDirectory(const base::FilePath& path) { 86 bool IsDirectory(const base::FilePath& path) {
87 base::PlatformFileInfo file_info; 87 base::PlatformFileInfo file_info;
88 return file_util::GetFileInfo(path, &file_info) ? 88 return file_util::GetFileInfo(path, &file_info) ?
89 file_info.is_directory : file_util::EndsWithSeparator(path); 89 file_info.is_directory : path.EndsWithSeparator();
90 } 90 }
91 91
92 // Get the file type description from the registry. This will be "Text Document" 92 // Get the file type description from the registry. This will be "Text Document"
93 // for .txt files, "JPEG Image" for .jpg files, etc. If the registry doesn't 93 // for .txt files, "JPEG Image" for .jpg files, etc. If the registry doesn't
94 // have an entry for the file type, we return false, true if the description was 94 // have an entry for the file type, we return false, true if the description was
95 // found. 'file_ext' must be in form ".txt". 95 // found. 'file_ext' must be in form ".txt".
96 static bool GetRegistryDescriptionFromExtension(const std::wstring& file_ext, 96 static bool GetRegistryDescriptionFromExtension(const std::wstring& file_ext,
97 std::wstring* reg_description) { 97 std::wstring* reg_description) {
98 DCHECK(reg_description); 98 DCHECK(reg_description);
99 base::win::RegKey reg_ext(HKEY_CLASSES_ROOT, file_ext.c_str(), KEY_READ); 99 base::win::RegKey reg_ext(HKEY_CLASSES_ROOT, file_ext.c_str(), KEY_READ);
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 return return_value; 914 return return_value;
915 } 915 }
916 916
917 SelectFileDialog* CreateWinSelectFileDialog( 917 SelectFileDialog* CreateWinSelectFileDialog(
918 SelectFileDialog::Listener* listener, 918 SelectFileDialog::Listener* listener,
919 SelectFilePolicy* policy) { 919 SelectFilePolicy* policy) {
920 return new SelectFileDialogImpl(listener, policy); 920 return new SelectFileDialogImpl(listener, policy);
921 } 921 }
922 922
923 } // namespace ui 923 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698