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 "app/win_util.h" | 5 #include "app/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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 return false; | 236 return false; |
237 } | 237 } |
238 | 238 |
239 std::wstring FormatFilterForExtensions( | 239 std::wstring FormatFilterForExtensions( |
240 const std::vector<std::wstring>& file_ext, | 240 const std::vector<std::wstring>& file_ext, |
241 const std::vector<std::wstring>& ext_desc, | 241 const std::vector<std::wstring>& ext_desc, |
242 bool include_all_files) { | 242 bool include_all_files) { |
243 const std::wstring all_ext = L"*.*"; | 243 const std::wstring all_ext = L"*.*"; |
244 const std::wstring all_desc = l10n_util::GetString(IDS_APP_SAVEAS_ALL_FILES); | 244 const std::wstring all_desc = l10n_util::GetString(IDS_APP_SAVEAS_ALL_FILES); |
245 | 245 |
246 DCHECK(file_ext.size()>=ext_desc.size()); | 246 DCHECK(file_ext.size() >= ext_desc.size()); |
247 | 247 |
248 std::wstring result; | 248 std::wstring result; |
249 | 249 |
250 for (size_t i=0; i<file_ext.size(); ++i) { | 250 for (size_t i = 0; i < file_ext.size(); ++i) { |
251 std::wstring ext = file_ext[i]; | 251 std::wstring ext = file_ext[i]; |
252 std::wstring desc; | 252 std::wstring desc; |
253 if (i<ext_desc.size()) | 253 if (i < ext_desc.size()) |
254 desc = ext_desc[i]; | 254 desc = ext_desc[i]; |
255 | 255 |
256 if (ext.empty()) { | 256 if (ext.empty()) { |
257 // Force something reasonable to appear in the dialog box if there is no | 257 // Force something reasonable to appear in the dialog box if there is no |
258 // extension provided. | 258 // extension provided. |
259 include_all_files = true; | 259 include_all_files = true; |
260 continue; | 260 continue; |
261 } | 261 } |
262 | 262 |
263 if (desc.empty()) { | 263 if (desc.empty()) { |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 if (S_OK == pps->SetValue(PKEY_AppUserModel_ID, pv)) | 877 if (S_OK == pps->SetValue(PKEY_AppUserModel_ID, pv)) |
878 pps->Commit(); | 878 pps->Commit(); |
879 } | 879 } |
880 | 880 |
881 // Cleanup. | 881 // Cleanup. |
882 PropVariantClear(&pv); | 882 PropVariantClear(&pv); |
883 base::UnloadNativeLibrary(shell32_library); | 883 base::UnloadNativeLibrary(shell32_library); |
884 } | 884 } |
885 | 885 |
886 } // namespace win_util | 886 } // namespace win_util |
OLD | NEW |