| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 *index = save_as.nFilterIndex; | 302 *index = save_as.nFilterIndex; |
| 303 | 303 |
| 304 // Figure out what filter got selected from the vector with embedded nulls. | 304 // Figure out what filter got selected from the vector with embedded nulls. |
| 305 // NOTE: The filter contains a string with embedded nulls, such as: | 305 // NOTE: The filter contains a string with embedded nulls, such as: |
| 306 // JPG Image\0*.jpg\0All files\0*.*\0\0 | 306 // JPG Image\0*.jpg\0All files\0*.*\0\0 |
| 307 // The filter index is 1-based index for which pair got selected. So, using | 307 // The filter index is 1-based index for which pair got selected. So, using |
| 308 // the example above, if the first index was selected we need to skip 1 | 308 // the example above, if the first index was selected we need to skip 1 |
| 309 // instance of null to get to "*.jpg". | 309 // instance of null to get to "*.jpg". |
| 310 std::vector<std::wstring> filters; | 310 std::vector<std::wstring> filters; |
| 311 if (!filter.empty() && save_as.nFilterIndex > 0) | 311 if (!filter.empty() && save_as.nFilterIndex > 0) |
| 312 SplitString(filter, '\0', &filters); | 312 base::SplitString(filter, '\0', &filters); |
| 313 std::wstring filter_selected; | 313 std::wstring filter_selected; |
| 314 if (!filters.empty()) | 314 if (!filters.empty()) |
| 315 filter_selected = filters[(2 * (save_as.nFilterIndex - 1)) + 1]; | 315 filter_selected = filters[(2 * (save_as.nFilterIndex - 1)) + 1]; |
| 316 | 316 |
| 317 // Get the extension that was suggested to the user (when the Save As dialog | 317 // Get the extension that was suggested to the user (when the Save As dialog |
| 318 // was opened). For saving web pages, we skip this step since there may be | 318 // was opened). For saving web pages, we skip this step since there may be |
| 319 // 'extension characters' in the title of the web page. | 319 // 'extension characters' in the title of the web page. |
| 320 std::wstring suggested_ext; | 320 std::wstring suggested_ext; |
| 321 if (!ignore_suggested_ext) | 321 if (!ignore_suggested_ext) |
| 322 suggested_ext = file_util::GetFileExtensionFromPath(suggested_name); | 322 suggested_ext = file_util::GetFileExtensionFromPath(suggested_name); |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { | 1120 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { |
| 1121 if (listener_) | 1121 if (listener_) |
| 1122 listener_->FontSelectionCanceled(params); | 1122 listener_->FontSelectionCanceled(params); |
| 1123 EndRun(run_state); | 1123 EndRun(run_state); |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 // static | 1126 // static |
| 1127 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { | 1127 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { |
| 1128 return new SelectFontDialogImpl(listener); | 1128 return new SelectFontDialogImpl(listener); |
| 1129 } | 1129 } |
| OLD | NEW |