| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/common/win_util.h" | 5 #include "chrome/common/win_util.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlapp.h> | 8 #include <atlapp.h> |
| 9 #include <commdlg.h> | 9 #include <commdlg.h> |
| 10 #include <dwmapi.h> | 10 #include <dwmapi.h> |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 // Set up the initial directory for the dialog. | 374 // Set up the initial directory for the dialog. |
| 375 std::wstring directory = file_util::GetDirectoryFromPath(suggested_name); | 375 std::wstring directory = file_util::GetDirectoryFromPath(suggested_name); |
| 376 save_as.lpstrInitialDir = directory.c_str(); | 376 save_as.lpstrInitialDir = directory.c_str(); |
| 377 save_as.lpstrTitle = NULL; | 377 save_as.lpstrTitle = NULL; |
| 378 save_as.Flags = OFN_OVERWRITEPROMPT | OFN_EXPLORER | OFN_ENABLESIZING | | 378 save_as.Flags = OFN_OVERWRITEPROMPT | OFN_EXPLORER | OFN_ENABLESIZING | |
| 379 OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST; | 379 OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST; |
| 380 save_as.lpstrDefExt = &def_ext[0]; | 380 save_as.lpstrDefExt = &def_ext[0]; |
| 381 save_as.lCustData = NULL; | 381 save_as.lCustData = NULL; |
| 382 | 382 |
| 383 if (win_util::GetWinVersion() <= win_util::WINVERSION_VISTA) { | 383 if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { |
| 384 // The save as on Windows XP and Windows Vista remembers its last position, | 384 // The save as on Windows XP remembers its last position, |
| 385 // and if the screen resolution changed, it will be off screen. | 385 // and if the screen resolution changed, it will be off screen. |
| 386 save_as.Flags |= OFN_ENABLEHOOK; | 386 save_as.Flags |= OFN_ENABLEHOOK; |
| 387 save_as.lpfnHook = &SaveAsDialogHook; | 387 save_as.lpfnHook = &SaveAsDialogHook; |
| 388 } | 388 } |
| 389 | 389 |
| 390 // Must be NULL or 0. | 390 // Must be NULL or 0. |
| 391 save_as.pvReserved = NULL; | 391 save_as.pvReserved = NULL; |
| 392 save_as.dwReserved = 0; | 392 save_as.dwReserved = 0; |
| 393 | 393 |
| 394 if (!GetSaveFileName(&save_as)) { | 394 if (!GetSaveFileName(&save_as)) { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 } | 851 } |
| 852 | 852 |
| 853 ChromeFont GetWindowTitleFont() { | 853 ChromeFont GetWindowTitleFont() { |
| 854 NONCLIENTMETRICS ncm; | 854 NONCLIENTMETRICS ncm; |
| 855 win_util::GetNonClientMetrics(&ncm); | 855 win_util::GetNonClientMetrics(&ncm); |
| 856 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 856 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
| 857 return ChromeFont::CreateFont(caption_font); | 857 return ChromeFont::CreateFont(caption_font); |
| 858 } | 858 } |
| 859 | 859 |
| 860 } // namespace win_util | 860 } // namespace win_util |
| OLD | NEW |