| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 #ifndef UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ | 5 #ifndef UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ |
| 6 #define UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ | 6 #define UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ |
| 7 | 7 |
| 8 #include <Windows.h> | 8 #include <Windows.h> |
| 9 #include <Commdlg.h> | 9 #include <Commdlg.h> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 ~OpenFileName(); | 33 ~OpenFileName(); |
| 34 | 34 |
| 35 // Initializes |lpstrFilter| from the label/pattern pairs in |filters|. | 35 // Initializes |lpstrFilter| from the label/pattern pairs in |filters|. |
| 36 void SetFilters( | 36 void SetFilters( |
| 37 const std::vector<std::tuple<base::string16, base::string16>>& filters); | 37 const std::vector<std::tuple<base::string16, base::string16>>& filters); |
| 38 | 38 |
| 39 // Sets |lpstrInitialDir| and |lpstrFile|. | 39 // Sets |lpstrInitialDir| and |lpstrFile|. |
| 40 void SetInitialSelection(const base::FilePath& initial_directory, | 40 void SetInitialSelection(const base::FilePath& initial_directory, |
| 41 const base::FilePath& initial_filename); | 41 const base::FilePath& initial_filename); |
| 42 | 42 |
| 43 // The save as dialog on Windows XP remembers its last position, and if the | |
| 44 // screen resolution has changed it may be off screen. This method will check | |
| 45 // if we are running on XP and if so install a hook to reposition the dialog | |
| 46 // if necessary. | |
| 47 void MaybeInstallWindowPositionHookForSaveAsOnXP(); | |
| 48 | |
| 49 // Returns the single selected file, or an empty path if there are more or | 43 // Returns the single selected file, or an empty path if there are more or |
| 50 // less than one results. | 44 // less than one results. |
| 51 base::FilePath GetSingleResult(); | 45 base::FilePath GetSingleResult(); |
| 52 | 46 |
| 53 // Returns the selected file or files. | 47 // Returns the selected file or files. |
| 54 void GetResult(base::FilePath* directory, | 48 void GetResult(base::FilePath* directory, |
| 55 std::vector<base::FilePath>* filenames); | 49 std::vector<base::FilePath>* filenames); |
| 56 | 50 |
| 57 // Returns the OPENFILENAME structure. | 51 // Returns the OPENFILENAME structure. |
| 58 OPENFILENAME* GetOPENFILENAME() { return &openfilename_; } | 52 OPENFILENAME* GetOPENFILENAME() { return &openfilename_; } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 77 wchar_t filename_buffer_[UNICODE_STRING_MAX_CHARS]; | 71 wchar_t filename_buffer_[UNICODE_STRING_MAX_CHARS]; |
| 78 base::string16 filter_buffer_; | 72 base::string16 filter_buffer_; |
| 79 | 73 |
| 80 DISALLOW_COPY_AND_ASSIGN(OpenFileName); | 74 DISALLOW_COPY_AND_ASSIGN(OpenFileName); |
| 81 }; | 75 }; |
| 82 | 76 |
| 83 } // namespace win | 77 } // namespace win |
| 84 } // namespace ui | 78 } // namespace ui |
| 85 | 79 |
| 86 #endif // UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ | 80 #endif // UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ |
| OLD | NEW |