win: Open dialog and save dialog can have different options.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 18 Sep 2013 14:27:40 +0000 (22:27 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 18 Sep 2013 14:27:40 +0000 (22:27 +0800)
browser/ui/file_dialog_win.cc

index eff0559..9ff5bf5 100644 (file)
@@ -137,6 +137,7 @@ class FileDialog {
  public:
   FileDialog(const base::FilePath& default_path,
              const std::string title,
+             int options,
              const std::vector<std::wstring>& file_ext,
              const std::vector<std::wstring>& desc_ext)
       : file_ext_(file_ext),
@@ -150,7 +151,7 @@ class FileDialog {
 
     dialog_.reset(new T(
         file_part.c_str(),
-        FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT,
+        options,
         NULL,
         filters.data(),
         filters.size()));
@@ -217,6 +218,7 @@ bool ShowSaveDialog(atom::NativeWindow* window,
   FileDialog<CShellFileSaveDialog> save_dialog(
       default_path,
       title,
+      FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT,
       file_ext,
       std::vector<std::wstring>());
   if (!save_dialog.Show(window))