OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 | 271 |
272 result.append(1, '\0'); // Double NULL required. | 272 result.append(1, '\0'); // Double NULL required. |
273 return result; | 273 return result; |
274 } | 274 } |
275 | 275 |
276 bool SaveFileAs(HWND owner, | 276 bool SaveFileAs(HWND owner, |
277 const std::wstring& suggested_name, | 277 const std::wstring& suggested_name, |
278 std::wstring* final_name) { | 278 std::wstring* final_name) { |
279 std::wstring file_ext = file_util::GetFileExtensionFromPath(suggested_name); | 279 std::wstring file_ext = file_util::GetFileExtensionFromPath(suggested_name); |
280 file_ext.insert(L'.', 0); | 280 file_ext.insert(0, L"*."); |
281 std::wstring filter = FormatFilterForExtensions( | 281 std::wstring filter = FormatFilterForExtensions( |
282 std::vector<std::wstring>(1, file_ext), | 282 std::vector<std::wstring>(1, file_ext), |
283 std::vector<std::wstring>(), | 283 std::vector<std::wstring>(), |
284 true); | 284 true); |
285 unsigned index = 1; | 285 unsigned index = 1; |
286 return SaveFileAsWithFilter(owner, | 286 return SaveFileAsWithFilter(owner, |
287 suggested_name, | 287 suggested_name, |
288 filter, | 288 filter, |
289 L"", | 289 L"", |
290 false, | 290 false, |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 | 815 |
816 ChromeFont GetWindowTitleFont() { | 816 ChromeFont GetWindowTitleFont() { |
817 NONCLIENTMETRICS ncm; | 817 NONCLIENTMETRICS ncm; |
818 win_util::GetNonClientMetrics(&ncm); | 818 win_util::GetNonClientMetrics(&ncm); |
819 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 819 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
820 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 820 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
821 return ChromeFont::CreateFont(caption_font); | 821 return ChromeFont::CreateFont(caption_font); |
822 } | 822 } |
823 | 823 |
824 } // namespace win_util | 824 } // namespace win_util |
OLD | NEW |