Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: ui/base/win/open_file_name_win.h

Issue 419523006: Experimentally isolate GetOpenFileName in a utility process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/win/open_file_name_win.h
diff --git a/ui/base/win/open_file_name_win.h b/ui/base/win/open_file_name_win.h
index 8392efc32bc167cf1fa4a06a738db4b47e7048fb..da04ffc2ca738006e6bf90b23dc1b3a92710e829 100644
--- a/ui/base/win/open_file_name_win.h
+++ b/ui/base/win/open_file_name_win.h
@@ -31,6 +31,10 @@ class OpenFileName {
OpenFileName(HWND parent_window, DWORD flags);
~OpenFileName();
+ // Initializes |lpstrFilter| from the label/pattern pairs in |filters|.
+ void SetFilters(
+ const std::vector<Tuple2<base::string16, base::string16> >& filters);
+
// Sets |lpstrInitialDir| and |lpstrFile|.
void SetInitialSelection(const base::FilePath& initial_directory,
const base::FilePath& initial_filename);
@@ -46,10 +50,25 @@ class OpenFileName {
// Returns the OPENFILENAME structure.
OPENFILENAME* Get();
+ // Returns the OPENFILENAME structure.
+ const OPENFILENAME* Get() const;
+
+ // Stores directory and filenames in the buffer pointed to by
+ // |openfilename->lpstrFile| and sized |openfilename->nMaxFile|.
+ static void SetResult(const base::FilePath& directory,
+ const std::vector<base::FilePath>& filenames,
+ OPENFILENAME* openfilename);
+
+ // Returns a vector of label/pattern pairs built from
+ // |openfilename->lpstrFilter|.
+ static std::vector<Tuple2<base::string16, base::string16> > GetFilters(
+ const OPENFILENAME* openfilename);
+
private:
OPENFILENAME openfilename_;
base::string16 initial_directory_buffer_;
wchar_t filename_buffer_[UNICODE_STRING_MAX_CHARS];
+ base::string16 filter_buffer_;
DISALLOW_COPY_AND_ASSIGN(OpenFileName);
};

Powered by Google App Engine
This is Rietveld 408576698