| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 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 | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #ifndef UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ | 
|  | 6 #define UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ | 
|  | 7 | 
|  | 8 #include <Windows.h> | 
|  | 9 #include <Commdlg.h> | 
|  | 10 | 
|  | 11 #include <vector> | 
|  | 12 | 
|  | 13 #include "base/macros.h" | 
|  | 14 #include "base/strings/string16.h" | 
|  | 15 #include "base/tuple.h" | 
|  | 16 #include "ui/base/ui_base_export.h" | 
|  | 17 | 
|  | 18 namespace base { | 
|  | 19 class FilePath; | 
|  | 20 }  // namespace base | 
|  | 21 | 
|  | 22 namespace ui { | 
|  | 23 namespace win { | 
|  | 24 | 
|  | 25 // Encapsulates an OPENFILENAME struct and related buffers. Also provides static | 
|  | 26 // methods for interpreting the properties of an OPENFILENAME. | 
|  | 27 class UI_BASE_EXPORT OpenFileName { | 
|  | 28  public: | 
|  | 29   // Initializes the OPENFILENAME, which may be accessed using Get(). All fields | 
|  | 30   // will be NULL except for |lStructSize|, |lpstrFile|, and |nMaxFile|. The | 
|  | 31   // file buffer will initially contain a null-terminated empty string. | 
|  | 32   OpenFileName(HWND parent_window, DWORD flags); | 
|  | 33   ~OpenFileName(); | 
|  | 34 | 
|  | 35   // Sets |lpstrInitialDir| and |lpstrFile|. | 
|  | 36   void SetInitialSelection(const base::FilePath& initial_directory, | 
|  | 37                            const base::FilePath& initial_filename); | 
|  | 38 | 
|  | 39   // Returns the single selected file, or an empty path if there are more or | 
|  | 40   // less than one results. | 
|  | 41   base::FilePath GetSingleResult(); | 
|  | 42 | 
|  | 43   // Returns the selected file or files. | 
|  | 44   void GetResult(base::FilePath* directory, | 
|  | 45                  std::vector<base::FilePath>* filenames); | 
|  | 46 | 
|  | 47   // Returns the OPENFILENAME structure. | 
|  | 48   OPENFILENAME* GetOPENFILENAME() { return &openfilename_; } | 
|  | 49 | 
|  | 50  private: | 
|  | 51   OPENFILENAME openfilename_; | 
|  | 52   base::string16 initial_directory_buffer_; | 
|  | 53   wchar_t filename_buffer_[UNICODE_STRING_MAX_CHARS]; | 
|  | 54 | 
|  | 55   DISALLOW_COPY_AND_ASSIGN(OpenFileName); | 
|  | 56 }; | 
|  | 57 | 
|  | 58 }  // namespace win | 
|  | 59 }  // namespace ui | 
|  | 60 | 
|  | 61 #endif  // UI_BASE_WIN_OPEN_FILE_NAME_WIN_H_ | 
| OLD | NEW | 
|---|