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

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

Issue 105293002: Move more file_util functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 79
80 return metro_get_save_file_name(ofn) == TRUE; 80 return metro_get_save_file_name(ofn) == TRUE;
81 } else { 81 } else {
82 return GetSaveFileName(ofn) == TRUE; 82 return GetSaveFileName(ofn) == TRUE;
83 } 83 }
84 } 84 }
85 85
86 // Distinguish directories from regular files. 86 // Distinguish directories from regular files.
87 bool IsDirectory(const base::FilePath& path) { 87 bool IsDirectory(const base::FilePath& path) {
88 base::PlatformFileInfo file_info; 88 base::PlatformFileInfo file_info;
89 return file_util::GetFileInfo(path, &file_info) ? 89 return base::GetFileInfo(path, &file_info) ?
90 file_info.is_directory : path.EndsWithSeparator(); 90 file_info.is_directory : path.EndsWithSeparator();
91 } 91 }
92 92
93 // Get the file type description from the registry. This will be "Text Document" 93 // Get the file type description from the registry. This will be "Text Document"
94 // for .txt files, "JPEG Image" for .jpg files, etc. If the registry doesn't 94 // for .txt files, "JPEG Image" for .jpg files, etc. If the registry doesn't
95 // have an entry for the file type, we return false, true if the description was 95 // have an entry for the file type, we return false, true if the description was
96 // found. 'file_ext' must be in form ".txt". 96 // found. 'file_ext' must be in form ".txt".
97 static bool GetRegistryDescriptionFromExtension(const std::wstring& file_ext, 97 static bool GetRegistryDescriptionFromExtension(const std::wstring& file_ext,
98 std::wstring* reg_description) { 98 std::wstring* reg_description) {
99 DCHECK(reg_description); 99 DCHECK(reg_description);
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 return return_value; 945 return return_value;
946 } 946 }
947 947
948 SelectFileDialog* CreateWinSelectFileDialog( 948 SelectFileDialog* CreateWinSelectFileDialog(
949 SelectFileDialog::Listener* listener, 949 SelectFileDialog::Listener* listener,
950 SelectFilePolicy* policy) { 950 SelectFilePolicy* policy) {
951 return new SelectFileDialogImpl(listener, policy); 951 return new SelectFileDialogImpl(listener, policy);
952 } 952 }
953 953
954 } // namespace ui 954 } // namespace ui
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_linux.cc ('k') | webkit/browser/blob/local_file_stream_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698