OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/shell_dialogs.h" | 5 #include "chrome/browser/shell_dialogs.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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 // According to http://support.microsoft.com/?scid=kb;en-us;222003&x=8&y=12, | 839 // According to http://support.microsoft.com/?scid=kb;en-us;222003&x=8&y=12, |
840 // The lpstrFile Buffer MUST be NULL Terminated. | 840 // The lpstrFile Buffer MUST be NULL Terminated. |
841 filename[0] = 0; | 841 filename[0] = 0; |
842 // Define the dir in here to keep the string buffer pointer pointed to | 842 // Define the dir in here to keep the string buffer pointer pointed to |
843 // ofn.lpstrInitialDir available during the period of running the | 843 // ofn.lpstrInitialDir available during the period of running the |
844 // GetOpenFileName. | 844 // GetOpenFileName. |
845 FilePath dir; | 845 FilePath dir; |
846 // Use lpstrInitialDir to specify the initial directory | 846 // Use lpstrInitialDir to specify the initial directory |
847 if (!path->empty()) { | 847 if (!path->empty()) { |
848 bool is_dir; | 848 bool is_dir; |
849 file_util::FileInfo file_info; | 849 base::PlatformFileInfo file_info; |
850 if (file_util::GetFileInfo(*path, &file_info)) | 850 if (file_util::GetFileInfo(*path, &file_info)) |
851 is_dir = file_info.is_directory; | 851 is_dir = file_info.is_directory; |
852 else | 852 else |
853 is_dir = file_util::EndsWithSeparator(*path); | 853 is_dir = file_util::EndsWithSeparator(*path); |
854 if (is_dir) { | 854 if (is_dir) { |
855 ofn.lpstrInitialDir = path->value().c_str(); | 855 ofn.lpstrInitialDir = path->value().c_str(); |
856 } else { | 856 } else { |
857 dir = path->DirName(); | 857 dir = path->DirName(); |
858 ofn.lpstrInitialDir = dir.value().c_str(); | 858 ofn.lpstrInitialDir = dir.value().c_str(); |
859 // Only pure filename can be put in lpstrFile field. | 859 // Only pure filename can be put in lpstrFile field. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { | 1119 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { |
1120 if (listener_) | 1120 if (listener_) |
1121 listener_->FontSelectionCanceled(params); | 1121 listener_->FontSelectionCanceled(params); |
1122 EndRun(run_state); | 1122 EndRun(run_state); |
1123 } | 1123 } |
1124 | 1124 |
1125 // static | 1125 // static |
1126 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { | 1126 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { |
1127 return new SelectFontDialogImpl(listener); | 1127 return new SelectFontDialogImpl(listener); |
1128 } | 1128 } |
OLD | NEW |