summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 23:35:34 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 23:35:34 +0000
commit009abc496589732a2ae51024c5a276c80bcde0e5 (patch)
tree7989af0c47215623198ad35a644ea5d33cc5d517
parentdc64a63b39f2a047dd597068182c01a2943c396b (diff)
downloadchromium_src-009abc496589732a2ae51024c5a276c80bcde0e5.zip
chromium_src-009abc496589732a2ae51024c5a276c80bcde0e5.tar.gz
chromium_src-009abc496589732a2ae51024c5a276c80bcde0e5.tar.bz2
Modify the save as code to be able to display the new enhanced
save dialog on Windows 7. BUG: 8409 Review URL: http://codereview.chromium.org/42666 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12621 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/win_util.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc
index adf775d..a999779 100644
--- a/chrome/common/win_util.cc
+++ b/chrome/common/win_util.cc
@@ -376,10 +376,16 @@ bool SaveFileAsWithFilter(HWND owner,
save_as.lpstrInitialDir = directory.c_str();
save_as.lpstrTitle = NULL;
save_as.Flags = OFN_OVERWRITEPROMPT | OFN_EXPLORER | OFN_ENABLESIZING |
- OFN_ENABLEHOOK | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST;
+ OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST;
save_as.lpstrDefExt = &def_ext[0];
save_as.lCustData = NULL;
- save_as.lpfnHook = &SaveAsDialogHook;
+
+ if (win_util::GetWinVersion() <= win_util::WINVERSION_VISTA) {
+ // The save as on Windows XP and Windows Vista remembers its last position,
+ // and if the screen resolution changed, it will be off screen.
+ save_as.Flags |= OFN_ENABLEHOOK;
+ save_as.lpfnHook = &SaveAsDialogHook;
+ }
// Must be NULL or 0.
save_as.pvReserved = NULL;