| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 save_as.lpstrCustomFilter = NULL; | 264 save_as.lpstrCustomFilter = NULL; |
| 265 save_as.nMaxCustFilter = 0; | 265 save_as.nMaxCustFilter = 0; |
| 266 save_as.nFilterIndex = *index; | 266 save_as.nFilterIndex = *index; |
| 267 save_as.lpstrFile = file_name; | 267 save_as.lpstrFile = file_name; |
| 268 save_as.nMaxFile = arraysize(file_name); | 268 save_as.nMaxFile = arraysize(file_name); |
| 269 save_as.lpstrFileTitle = NULL; | 269 save_as.lpstrFileTitle = NULL; |
| 270 save_as.nMaxFileTitle = 0; | 270 save_as.nMaxFileTitle = 0; |
| 271 | 271 |
| 272 // Set up the initial directory for the dialog. | 272 // Set up the initial directory for the dialog. |
| 273 std::wstring directory = file_util::GetDirectoryFromPath(suggested_name); | 273 std::wstring directory = FilePath(suggested_name).DirName().value(); |
| 274 save_as.lpstrInitialDir = directory.c_str(); | 274 save_as.lpstrInitialDir = directory.c_str(); |
| 275 save_as.lpstrTitle = NULL; | 275 save_as.lpstrTitle = NULL; |
| 276 save_as.Flags = OFN_OVERWRITEPROMPT | OFN_EXPLORER | OFN_ENABLESIZING | | 276 save_as.Flags = OFN_OVERWRITEPROMPT | OFN_EXPLORER | OFN_ENABLESIZING | |
| 277 OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST; | 277 OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST; |
| 278 save_as.lpstrDefExt = &def_ext[0]; | 278 save_as.lpstrDefExt = &def_ext[0]; |
| 279 save_as.lCustData = NULL; | 279 save_as.lCustData = NULL; |
| 280 | 280 |
| 281 if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 281 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| 282 // The save as on Windows XP remembers its last position, | 282 // The save as on Windows XP remembers its last position, |
| 283 // and if the screen resolution changed, it will be off screen. | 283 // and if the screen resolution changed, it will be off screen. |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { | 1122 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { |
| 1123 if (listener_) | 1123 if (listener_) |
| 1124 listener_->FontSelectionCanceled(params); | 1124 listener_->FontSelectionCanceled(params); |
| 1125 EndRun(run_state); | 1125 EndRun(run_state); |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 // static | 1128 // static |
| 1129 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { | 1129 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { |
| 1130 return new SelectFontDialogImpl(listener); | 1130 return new SelectFontDialogImpl(listener); |
| 1131 } | 1131 } |
| OLD | NEW |